@@ -354,31 +354,19 @@ impl<'a> Parser<'a> {
354
354
355
355
crate fn expect_no_suffix ( diag : & Handler , sp : Span , kind : & str , suffix : Option < Symbol > ) {
356
356
if let Some ( suf) = suffix {
357
- let mut err = if kind == "a tuple index" &&
358
- [ sym:: i32, sym:: u32, sym:: isize, sym:: usize] . contains ( & suf) {
359
- // #59553: warn instead of reject out of hand to allow the fix to percolate
360
- // through the ecosystem when people fix their macros
361
- let mut err = diag. struct_span_warn (
362
- sp,
363
- & format ! ( "suffixes on {} are invalid" , kind) ,
364
- ) ;
365
- err. note ( & format ! (
366
- "`{}` is *temporarily* accepted on tuple index fields as it was \
367
- incorrectly accepted on stable for a few releases",
368
- suf,
369
- ) ) ;
357
+ let mut err = diag. struct_span_err ( sp, & format ! ( "suffixes on {} are invalid" , kind) ) ;
358
+
359
+ if kind == "a tuple index"
360
+ && [ sym:: i32, sym:: u32, sym:: isize, sym:: usize] . contains ( & suf)
361
+ {
370
362
err. help (
371
363
"on proc macros, you'll want to use `syn::Index::from` or \
372
- `proc_macro::Literal::*_unsuffixed` for code that will desugar \
373
- to tuple field access",
374
- ) ;
375
- err. note (
376
- "for more context, see https://github.com/rust-lang/rust/issues/60210" ,
364
+ `proc_macro::Literal::*_unsuffixed` for code that will desugar \
365
+ to tuple field access",
377
366
) ;
378
- err
379
- } else {
380
- diag. struct_span_err ( sp, & format ! ( "suffixes on {} are invalid" , kind) )
381
- } ;
367
+ err. note ( "for more context, see https://github.com/rust-lang/rust/issues/60210" ) ;
368
+ }
369
+
382
370
err. span_label ( sp, format ! ( "invalid suffix `{}`" , suf) ) ;
383
371
err. emit ( ) ;
384
372
}
0 commit comments