macros: improve struct constructor field hygiene, fix span bug by jseyfried · Pull Request #48082 · rust-lang/rust (original) (raw)
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation11 Commits4 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
The issue was that we were privacy-checking fields in struct constructors/patterns using the hygiene of the span of the whole field expression, e.g. x: 0
, not the hygiene of just the field name (the x
).
jseyfried changed the title
Improve struct field hygiene macros: improve struct constructor field hygiene, fix span bug
Some UI tests need to be updated for new spans.
r=me after that
Ping from triage, @jseyfried — will you be able to address the UI test failures sometime soon?
Yeah, weekend.
@bors r=petrochenkov
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
📌 Commit 169643d has been approved by petrochenkov
Manishearth added a commit to Manishearth/rust that referenced this pull request
…ene, r=jseyfried
macros: improve struct constructor field hygiene, fix span bug
Fixes rust-lang#47311. r? @nrc
Might be your failure?
[01:34:13] failures:
[01:34:13]
[01:34:13] ---- [pretty] run-pass/hygiene/issue-47311.rs stdout ----
[01:34:13]
[01:34:13] error: pretty-printed source does not typecheck
[01:34:13] status: exit code: 101
[01:34:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-" "-Zno-trans" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/hygiene/issue-47311.pretty-out" "--target=x86_64-unknown-linux-gnu" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/hygiene/issue-47311.stage2-x86_64-unknown-linux-gnu.pretty.aux" "-Crpath" "-O" "-Zmiri" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
[01:34:13] stdout:
[01:34:13] ------------------------------------------
[01:34:13]
[01:34:13] ------------------------------------------
[01:34:13] stderr:
[01:34:13] ------------------------------------------
[01:34:13] error[E0433]: failed to resolve. Maybe a missing `extern crate m;`?
[01:34:13] --> <anon>:21:14
[01:34:13] |
[01:34:13] 21 | fn f() { ::m!(S , x); }
[01:34:13] | ^^^ Maybe a missing `extern crate m;`?
[01:34:13]
[01:34:13] error: aborting due to previous error
[01:34:13]
[01:34:13]
[01:34:13] ------------------------------------------
[01:34:13]
[01:34:13] thread '[pretty] run-pass/hygiene/issue-47311.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2892:9
[01:34:13] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:34:13]
[01:34:13]
[01:34:13] failures:
[01:34:13] [pretty] run-pass/hygiene/issue-47311.rs
bors added a commit that referenced this pull request
Rollup of 17 pull requests
- Successful merges: #48052, #48072, #48082, #48083, #48084, #48106, #48123, #48157, #48185, #48197, #48198, #48206, #48208, #48221, #48258, #48314, #48335
- Failed merges:
📌 Commit 1e037f4 has been approved by petrochenkov
bors added a commit that referenced this pull request
…ochenkov
macros: improve struct constructor field hygiene, fix span bug
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.