@@ -1303,21 +1303,28 @@ impl<'a> IntoDiagnostic<'a> for ExpectedSemi {
1303
1303
let token_descr = TokenDescription :: from_token ( & self . token ) ;
1304
1304
1305
1305
let mut diag = handler. struct_diagnostic ( match token_descr {
1306
- Some ( TokenDescription :: ReservedIdentifier ) => {
1307
- fluent:: parse_expected_semi_found_reserved_identifier_str
1306
+ Some ( TokenDescription :: ReservedIdentifier ) => DiagnosticMessage :: Str ( Cow :: from (
1307
+ "expected `;`, found reserved identifier `{$token}`" ,
1308
+ ) ) ,
1309
+ Some ( TokenDescription :: Keyword ) => {
1310
+ DiagnosticMessage :: Str ( Cow :: from ( "expected `;`, found keyword `{$token}`" ) )
1308
1311
}
1309
- Some ( TokenDescription :: Keyword ) => fluent:: parse_expected_semi_found_keyword_str,
1310
1312
Some ( TokenDescription :: ReservedKeyword ) => {
1311
- fluent:: parse_expected_semi_found_reserved_keyword_str
1313
+ DiagnosticMessage :: Str ( Cow :: from ( "expected `;`, found reserved keyword `{$token}`" ) )
1314
+ }
1315
+ Some ( TokenDescription :: DocComment ) => {
1316
+ DiagnosticMessage :: Str ( Cow :: from ( "expected `;`, found doc comment `{$token}`" ) )
1312
1317
}
1313
- Some ( TokenDescription :: DocComment ) => fluent:: parse_expected_semi_found_doc_comment_str,
1314
- None => fluent:: parse_expected_semi_found_str,
1318
+ None => DiagnosticMessage :: Str ( Cow :: from ( "expected `;`, found `{$token}`" ) ) ,
1315
1319
} ) ;
1316
1320
diag. set_span ( self . span ) ;
1317
1321
diag. set_arg ( "token" , self . token ) ;
1318
1322
1319
1323
if let Some ( unexpected_token_label) = self . unexpected_token_label {
1320
- diag. span_label ( unexpected_token_label, fluent:: parse_label_unexpected_token) ;
1324
+ diag. span_label (
1325
+ unexpected_token_label,
1326
+ DiagnosticMessage :: Str ( Cow :: from ( "unexpected token" ) ) ,
1327
+ ) ;
1321
1328
}
1322
1329
1323
1330
self . sugg . add_to_diagnostic ( & mut diag) ;
0 commit comments