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

estebank
Copy link
Contributor

@estebank estebank 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.

@estebank estebank added I-nominated beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 22, 2019
@rust-highfive
Copy link
Collaborator

r? @petrochenkov

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 22, 2019
@estebank
Copy link
Contributor Author

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
Copy link
Contributor Author

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 to giving some explicit help here!

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

Centril commented Apr 23, 2019

r? @nikomatsakis

@estebank
Copy link
Contributor Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 23, 2019

📌 Commit 4c01573 has been approved by nikomatsakis

@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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 23, 2019
Centril added a commit to Centril/rust that referenced this pull request Apr 24, 2019
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
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
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
@nagisa nagisa added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Apr 25, 2019
@pietroalbini pietroalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 26, 2019
bors added a commit that referenced this pull request Apr 27, 2019
[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
@estebank estebank deleted the accept-suffix branch November 9, 2023 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

suffixes on a tuple index are invalid
8 participants