Temporarily accept [i|u][32|size] suffixes on a tuple index and warn - #60186
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
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. |
| ); | ||
| err.note(&format!( | ||
| "`{}` is *temporarily* accepted on tuple index fields as it was \ | ||
| incorrectly accepted on stable for a few releases", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
👍 to giving some explicit help here!
commented
Apr 23, 2019
commented
Apr 23, 2019
|
@bors r=nikomatsakis |
commented
Apr 23, 2019
|
📌 Commit 4c01573 has been approved by |
Fix #60138.
#59553 will need to be kept open to track the change back to rejecting this code a few versions down thee line.