@@ -1119,9 +1119,8 @@ impl<'a> Parser<'a> {
11191119 if text. is_empty ( ) {
11201120 self . span_bug ( sp, "found empty literal suffix in Some" )
11211121 }
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) )
11251124 . emit ( ) ;
11261125 }
11271126 }
@@ -2150,7 +2149,7 @@ impl<'a> Parser<'a> {
21502149
21512150 if suffix_illegal {
21522151 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)
21542153 }
21552154
21562155 result. unwrap ( )
@@ -3205,7 +3204,7 @@ impl<'a> Parser<'a> {
32053204 let field = ExprKind :: Field ( e, Ident :: new ( name, span) ) ;
32063205 e = self . mk_expr ( lo. to ( span) , field, ThinVec :: new ( ) ) ;
32073206
3208- self . expect_no_suffix ( span, "tuple index" , suffix) ;
3207+ self . expect_no_suffix ( span, "a tuple index" , suffix) ;
32093208 }
32103209 token:: Literal ( token:: Float ( n) , _suf) => {
32113210 self . bump ( ) ;
@@ -7791,7 +7790,7 @@ impl<'a> Parser<'a> {
77917790 match self . token {
77927791 token:: Literal ( token:: Str_ ( s) , suf) | token:: Literal ( token:: StrRaw ( s, _) , suf) => {
77937792 let sp = self . span ;
7794- self . expect_no_suffix ( sp, "ABI spec" , suf) ;
7793+ self . expect_no_suffix ( sp, "an ABI spec" , suf) ;
77957794 self . bump ( ) ;
77967795 match abi:: lookup ( & s. as_str ( ) ) {
77977796 Some ( abi) => Ok ( Some ( abi) ) ,
@@ -8612,7 +8611,7 @@ impl<'a> Parser<'a> {
86128611 match self . parse_optional_str ( ) {
86138612 Some ( ( s, style, suf) ) => {
86148613 let sp = self . prev_span ;
8615- self . expect_no_suffix ( sp, "string literal" , suf) ;
8614+ self . expect_no_suffix ( sp, "a string literal" , suf) ;
86168615 Ok ( ( s, style) )
86178616 }
86188617 _ => {
0 commit comments