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

Improve tuple struct field access hygiene #48083

Merged

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented Feb 9, 2018

Fixes #47312 by fixing a span bug.
r? @nrc

@jseyfried
Copy link
Contributor Author

jseyfried commented Feb 9, 2018

The issue here was that the parser was assigning an incorrect span in a tuple struct field access expression, e.g. in x.0, the 0 was assigned the span .0 (including the dot).

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 9, 2018

📌 Commit 56b07b7 has been approved by petrochenkov

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 9, 2018
@petrochenkov petrochenkov assigned petrochenkov and unassigned nrc Feb 9, 2018
@kennytm
Copy link
Member

kennytm commented Feb 9, 2018

@bors r-

The new test case cannot be pretty-printed.

[01:40:50] failures:
[01:40:50] 
[01:40:50] ---- [pretty] run-pass/hygiene/issue-47312.rs stdout ----
[01:40:50] 	
[01:40:50] error: pretty-printed source does not typecheck
[01:40:50] status: exit code: 101
[01:40:50] 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-47312.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-47312.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:40:50] stdout:
[01:40:50] ------------------------------------------
[01:40:50] 
[01:40:50] ------------------------------------------
[01:40:50] stderr:
[01:40:50] ------------------------------------------
[01:40:50] error[E0433]: failed to resolve. Could not find `m` in `foo`
[01:40:50]   --> <anon>:20:28
[01:40:50]    |
[01:40:50] 20 |     fn f() { let s = S(0); ::foo::m!(s , 0); }
[01:40:50]    |                            ^^^^^^^^ Could not find `m` in `foo`
[01:40:50] 
[01:40:50] error: aborting due to previous error
[01:40:50] 
[01:40:50] 
[01:40:50] ------------------------------------------
[01:40:50] 
[01:40:50] thread '[pretty] run-pass/hygiene/issue-47312.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2883:9
[01:40:50] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:40:50] 
[01:40:50] 
[01:40:50] failures:
[01:40:50]     [pretty] run-pass/hygiene/issue-47312.rs

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 9, 2018
@jseyfried jseyfried force-pushed the improve_tuple_struct_field_access_hygiene branch from 56b07b7 to a003cb7 Compare February 11, 2018 10:19
@jseyfried
Copy link
Contributor Author

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Feb 12, 2018

📌 Commit a003cb7 has been approved by 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 12, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Feb 13, 2018
…d_access_hygiene, r=petrochenkov

Improve tuple struct field access hygiene

Fixes rust-lang#47312 by fixing a span bug.
r? @nrc
bors added a commit that referenced this pull request Feb 13, 2018
Rollup of 14 pull requests

- Successful merges: #47784, #47846, #48033, #48083, #48087, #48114, #48126, #48130, #48133, #48151, #48154, #48163, #48165, #48167
- Failed merges:
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 19, 2018
…d_access_hygiene, r=petrochenkov

Improve tuple struct field access hygiene

Fixes rust-lang#47312 by fixing a span bug.
r? @nrc
@ishitatsuyuki
Copy link
Contributor

Seems this failed rollup again.

bors added a commit that referenced this pull request Feb 20, 2018
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 23, 2018
…d_access_hygiene, r=petrochenkov

Improve tuple struct field access hygiene

Fixes rust-lang#47312 by fixing a span bug.
r? @nrc
bors added a commit that referenced this pull request Feb 23, 2018
Rollup of 12 pull requests

- Successful merges: #47933, #48072, #48083, #48123, #48157, #48219, #48221, #48245, #48429, #48436, #48438, #48472
- Failed merges:
bors added a commit that referenced this pull request Feb 24, 2018
Rollup of 12 pull requests

- Successful merges: #47933, #48072, #48083, #48123, #48157, #48219, #48221, #48245, #48429, #48436, #48438, #48472
- Failed merges:
@bors bors merged commit a003cb7 into rust-lang:master Feb 24, 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.

Inconsistency between accessing field of braced struct vs tuple struct in proc macro
6 participants