@@ -1408,9 +1408,10 @@ impl<'a> StringReader<'a> {
1408
1408
// lifetimes shouldn't end with a single quote
1409
1409
// if we find one, then this is an invalid character literal
1410
1410
if self . ch_is ( '\'' ) {
1411
- self . fatal_span_verbose ( start_with_quote, self . next_pos ,
1412
- String :: from ( "character literal may only contain one codepoint" ) )
1413
- . raise ( ) ;
1411
+ self . err_span_ ( start_with_quote, self . next_pos ,
1412
+ "character literal may only contain one codepoint" ) ;
1413
+ self . bump ( ) ;
1414
+ return Ok ( token:: Literal ( token:: Err ( Symbol :: intern ( "??" ) ) , None ) )
1414
1415
1415
1416
}
1416
1417
@@ -1445,7 +1446,7 @@ impl<'a> StringReader<'a> {
1445
1446
format ! ( "\" {}\" " , & self . src[ start..end] ) ,
1446
1447
Applicability :: MachineApplicable
1447
1448
) . emit ( ) ;
1448
- return Ok ( token:: Literal ( token:: Char ( Symbol :: intern ( "??" ) ) , None ) )
1449
+ return Ok ( token:: Literal ( token:: Err ( Symbol :: intern ( "??" ) ) , None ) )
1449
1450
}
1450
1451
if self . ch_is ( '\n' ) || self . is_eof ( ) || self . ch_is ( '/' ) {
1451
1452
// Only attempt to infer single line string literals. If we encounter
@@ -1455,8 +1456,9 @@ impl<'a> StringReader<'a> {
1455
1456
}
1456
1457
}
1457
1458
1458
- self . fatal_span_verbose ( start_with_quote, pos,
1459
- String :: from ( "character literal may only contain one codepoint" ) ) . raise ( ) ;
1459
+ self . err_span_ ( start_with_quote, pos,
1460
+ "character literal may only contain one codepoint" ) ;
1461
+ self . bump ( ) ;
1460
1462
}
1461
1463
1462
1464
let id = if valid {
0 commit comments