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

Temporarily accept [i|u][32|size] suffixes on a tuple index and warn #60186

Merged
merged 2 commits into from Apr 24, 2019

Conversation

Projects
None yet
8 participants
@estebank
Copy link
Contributor

commented Apr 22, 2019

Fix #60138.

#59553 will need to be kept open to track the change back to rejecting this code a few versions down thee line.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 22, 2019

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@estebank

This comment has been minimized.

Copy link
Contributor Author

commented Apr 22, 2019

I tried checking for only spans coming through the macro system, but because the error is pointing at the span for the proc macro itself, it is a regular span and we have no way to differentiate from regular field access.

The warning is unsilenceable on purpose.

@estebank

This comment has been minimized.

Copy link
Contributor Author

commented Apr 22, 2019

@estebank estebank force-pushed the estebank:accept-suffix branch from d502364 to e3fb331 Apr 22, 2019

@nikomatsakis
Copy link
Contributor

left a comment

r=me if we link to the new issue I just filed

);
err.note(&format!(
"`{}` is *temporarily* accepted on tuple index fields as it was \
incorrectly accepted on stable for a few releases",

This comment has been minimized.

Copy link
@nikomatsakis

nikomatsakis Apr 23, 2019

Contributor

This affects my opinion, by the way -- what is the range of time in which it was accepted? I was assuming it has been accepted forever.

This comment has been minimized.

Copy link
@Centril

Centril Apr 23, 2019

Member

Bisected (using godbolt) to 1.27 being the point at which it was allowed;
Test program:

fn main() {
    let x = (0,);
    x.0usize;
}
err.help(
"on proc macros, you'll want to use `syn::Index::from` or \
`proc_macro::Literal::*_unsuffixed` for code that will desugar \
to tuple field access",

This comment has been minimized.

Copy link
@nikomatsakis

nikomatsakis Apr 23, 2019

Contributor

👍 to giving some explicit help here!

Show resolved Hide resolved src/libsyntax/parse/parser.rs Outdated
@Centril

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

@estebank

This comment has been minimized.

Copy link
Contributor Author

commented Apr 23, 2019

@bors r=nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

📌 Commit 4c01573 has been approved by nikomatsakis

Centril added a commit to Centril/rust that referenced this pull request Apr 24, 2019

Rollup merge of rust-lang#60186 - estebank:accept-suffix, r=nikomatsakis
Temporarily accept [i|u][32|size] suffixes on a tuple index and warn

Fix rust-lang#60138.

rust-lang#59553 will need to be kept open to track the change back to rejecting this code a few versions down thee line.

Centril added a commit to Centril/rust that referenced this pull request Apr 24, 2019

Rollup merge of rust-lang#60186 - estebank:accept-suffix, r=nikomatsakis
Temporarily accept [i|u][32|size] suffixes on a tuple index and warn

Fix rust-lang#60138.

rust-lang#59553 will need to be kept open to track the change back to rejecting this code a few versions down thee line.

bors added a commit that referenced this pull request Apr 24, 2019

Auto merge of #60224 - Centril:rollup-lfuhhsk, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #56278 (Future-proof MIR for dedicated debuginfo.)
 - #59739 (Stabilize futures_api)
 - #59822 (Fix dark css rule)
 - #60186 (Temporarily accept [i|u][32|size] suffixes on a tuple index and warn)
 - #60190 (Don't generate unnecessary rmeta files.)

Failed merges:

r? @ghost

@bors bors merged commit 4c01573 into rust-lang:master Apr 24, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

bors added a commit that referenced this pull request Apr 26, 2019

Auto merge of #60311 - pietroalbini:beta-rollup, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #59886:  musl: do not compress debug section
* #59891:  Fix the link to sort_by_cached_key
* #59911: Revert "compile crates under test w/ -Zemit-stack-sizes"
* #59978: rustdoc: Remove default keyword from re-exported trait methods
* #59989: Fix links to Atomic* in RELEASES.md
* #60186: Temporarily accept [i|u][32|size] suffixes on a tuple index and warn
* #60309: Add 1.34.1 release notes

Rolled up:

* #60273: [beta] bootstrap; remove redundant imports.

r? @ghost

bors added a commit that referenced this pull request Apr 26, 2019

Auto merge of #60311 - pietroalbini:beta-rollup, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #59886:  musl: do not compress debug section
* #59891:  Fix the link to sort_by_cached_key
* #59911: Revert "compile crates under test w/ -Zemit-stack-sizes"
* #59978: rustdoc: Remove default keyword from re-exported trait methods
* #59989: Fix links to Atomic* in RELEASES.md
* #60186: Temporarily accept [i|u][32|size] suffixes on a tuple index and warn
* #60309: Add 1.34.1 release notes

Rolled up:

* #60273: [beta] bootstrap; remove redundant imports.

r? @ghost

bors added a commit that referenced this pull request Apr 27, 2019

Auto merge of #60311 - pietroalbini:beta-rollup, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #59886:  musl: do not compress debug section
* #59891:  Fix the link to sort_by_cached_key
* #59911: Revert "compile crates under test w/ -Zemit-stack-sizes"
* #59978: rustdoc: Remove default keyword from re-exported trait methods
* #59989: Fix links to Atomic* in RELEASES.md
* #60186: Temporarily accept [i|u][32|size] suffixes on a tuple index and warn
* #60309: Add 1.34.1 release notes

Rolled up:

* #60273: [beta] bootstrap; remove redundant imports.

r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.