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 }})

jseyfried

@jseyfried

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 titleImprove struct field hygiene macros: improve struct constructor field hygiene, fix span bug

Feb 9, 2018

@petrochenkov

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

@shepmaster

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

@jseyfried

@jseyfried

@jseyfried

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

📌 Commit 169643d has been approved by petrochenkov

Manishearth added a commit to Manishearth/rust that referenced this pull request

Feb 19, 2018

@Manishearth

…ene, r=jseyfried

macros: improve struct constructor field hygiene, fix span bug

Fixes rust-lang#47311. r? @nrc

@Manishearth

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

@jseyfried

@jseyfried

bors added a commit that referenced this pull request

Feb 20, 2018

@bors

Rollup of 17 pull requests

@petrochenkov

@bors

📌 Commit 1e037f4 has been approved by petrochenkov

@bors

bors added a commit that referenced this pull request

Feb 26, 2018

@bors

…ochenkov

macros: improve struct constructor field hygiene, fix span bug

Fixes #47311. r? @nrc

@bors

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.