@@ -1119,9 +1119,8 @@ impl<'a> Parser<'a> {
1119
1119
if text. is_empty ( ) {
1120
1120
self . span_bug ( sp, "found empty literal suffix in Some" )
1121
1121
}
1122
- let msg = format ! ( "{} with a suffix is invalid" , kind) ;
1123
- self . struct_span_err ( sp, & msg)
1124
- . span_label ( sp, msg)
1122
+ self . struct_span_err ( sp, & format ! ( "suffixes on {} are invalid" , kind) )
1123
+ . span_label ( sp, format ! ( "invalid suffix `{}`" , text) )
1125
1124
. emit ( ) ;
1126
1125
}
1127
1126
}
@@ -2150,7 +2149,7 @@ impl<'a> Parser<'a> {
2150
2149
2151
2150
if suffix_illegal {
2152
2151
let sp = self . span ;
2153
- self . expect_no_suffix ( sp, lit. literal_name ( ) , suf)
2152
+ self . expect_no_suffix ( sp, & format ! ( "a {}" , lit. literal_name( ) ) , suf)
2154
2153
}
2155
2154
2156
2155
result. unwrap ( )
@@ -3205,7 +3204,7 @@ impl<'a> Parser<'a> {
3205
3204
let field = ExprKind :: Field ( e, Ident :: new ( name, span) ) ;
3206
3205
e = self . mk_expr ( lo. to ( span) , field, ThinVec :: new ( ) ) ;
3207
3206
3208
- self . expect_no_suffix ( span, "tuple index" , suffix) ;
3207
+ self . expect_no_suffix ( span, "a tuple index" , suffix) ;
3209
3208
}
3210
3209
token:: Literal ( token:: Float ( n) , _suf) => {
3211
3210
self . bump ( ) ;
@@ -7791,7 +7790,7 @@ impl<'a> Parser<'a> {
7791
7790
match self . token {
7792
7791
token:: Literal ( token:: Str_ ( s) , suf) | token:: Literal ( token:: StrRaw ( s, _) , suf) => {
7793
7792
let sp = self . span ;
7794
- self . expect_no_suffix ( sp, "ABI spec" , suf) ;
7793
+ self . expect_no_suffix ( sp, "an ABI spec" , suf) ;
7795
7794
self . bump ( ) ;
7796
7795
match abi:: lookup ( & s. as_str ( ) ) {
7797
7796
Some ( abi) => Ok ( Some ( abi) ) ,
@@ -8612,7 +8611,7 @@ impl<'a> Parser<'a> {
8612
8611
match self . parse_optional_str ( ) {
8613
8612
Some ( ( s, style, suf) ) => {
8614
8613
let sp = self . prev_span ;
8615
- self . expect_no_suffix ( sp, "string literal" , suf) ;
8614
+ self . expect_no_suffix ( sp, "a string literal" , suf) ;
8616
8615
Ok ( ( s, style) )
8617
8616
}
8618
8617
_ => {
0 commit comments