Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macros: improve struct constructor field hygiene, fix span bug #48082

Merged
merged 4 commits into from
Feb 26, 2018

Conversation

jseyfried
Copy link
Contributor

Fixes #47311.
r? @nrc

@jseyfried
Copy link
Contributor Author

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 jseyfried changed the title Improve struct field hygiene macros: improve struct constructor field hygiene, fix span bug Feb 9, 2018
@petrochenkov
Copy link
Contributor

Some UI tests need to be updated for new spans.
r=me after that

@petrochenkov petrochenkov assigned petrochenkov and unassigned nrc Feb 9, 2018
@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 9, 2018
@shepmaster
Copy link
Member

Ping from triage, @jseyfried — will you be able to address the UI test failures sometime soon?

@jseyfried
Copy link
Contributor Author

jseyfried commented Feb 18, 2018

Yeah, weekend.
@bors r=petrochenkov

@bors 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 Feb 18, 2018
@bors
Copy link
Contributor

bors commented Feb 18, 2018

📌 Commit 169643d has been approved by petrochenkov

@rust-lang rust-lang deleted a comment from bors Feb 18, 2018
@rust-lang rust-lang deleted a comment from bors Feb 18, 2018
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 19, 2018
…ene, r=jseyfried

macros: improve struct constructor field hygiene, fix span bug

Fixes rust-lang#47311.
r? @nrc
@Manishearth
Copy link
Member

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

@jseyfried
Copy link
Contributor Author

@Manishearth Indeed, fixed.

bors added a commit that referenced this pull request Feb 20, 2018
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 25, 2018

📌 Commit 1e037f4 has been approved by petrochenkov

@bors
Copy link
Contributor

bors commented Feb 26, 2018

⌛ Testing commit 1e037f4 with merge 4a70e27...

bors added a commit that referenced this pull request Feb 26, 2018
…ochenkov

macros: improve struct constructor field hygiene, fix span bug

Fixes #47311.
r? @nrc
@bors
Copy link
Contributor

bors commented Feb 26, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: petrochenkov
Pushing 4a70e27 to master...

@bors bors merged commit 1e037f4 into rust-lang:master Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants