@@ -56,7 +56,7 @@ enum DestructuredFloat {
56
56
/// 1.2 | 1.2e3
57
57
MiddleDot ( Symbol , Span , Span , Symbol , Span ) ,
58
58
/// Invalid
59
- Error ,
59
+ Error ( ErrorGuaranteed ) ,
60
60
}
61
61
62
62
impl < ' a > Parser < ' a > {
@@ -1013,7 +1013,7 @@ impl<'a> Parser<'a> {
1013
1013
self . mk_expr_tuple_field_access ( lo, ident1_span, base, sym1, None ) ;
1014
1014
self . mk_expr_tuple_field_access ( lo, ident2_span, base1, sym2, suffix)
1015
1015
}
1016
- DestructuredFloat :: Error => base,
1016
+ DestructuredFloat :: Error ( _ ) => base,
1017
1017
} )
1018
1018
}
1019
1019
_ => {
@@ -1023,7 +1023,7 @@ impl<'a> Parser<'a> {
1023
1023
}
1024
1024
}
1025
1025
1026
- fn error_unexpected_after_dot ( & self ) {
1026
+ fn error_unexpected_after_dot ( & self ) -> ErrorGuaranteed {
1027
1027
let actual = pprust:: token_to_string ( & self . token ) ;
1028
1028
let span = self . token . span ;
1029
1029
let sm = self . psess . source_map ( ) ;
@@ -1033,7 +1033,7 @@ impl<'a> Parser<'a> {
1033
1033
}
1034
1034
_ => ( span, actual) ,
1035
1035
} ;
1036
- self . dcx ( ) . emit_err ( errors:: UnexpectedTokenAfterDot { span, actual } ) ;
1036
+ self . dcx ( ) . emit_err ( errors:: UnexpectedTokenAfterDot { span, actual } )
1037
1037
}
1038
1038
1039
1039
// We need an identifier or integer, but the next token is a float.
@@ -1121,8 +1121,8 @@ impl<'a> Parser<'a> {
1121
1121
// 1.2e+3 | 1.2e-3
1122
1122
[ IdentLike ( _) , Punct ( '.' ) , IdentLike ( _) , Punct ( '+' | '-' ) , IdentLike ( _) ] => {
1123
1123
// See the FIXME about `TokenCursor` above.
1124
- self . error_unexpected_after_dot ( ) ;
1125
- DestructuredFloat :: Error
1124
+ let guar = self . error_unexpected_after_dot ( ) ;
1125
+ DestructuredFloat :: Error ( guar )
1126
1126
}
1127
1127
_ => panic ! ( "unexpected components in a float token: {components:?}" ) ,
1128
1128
}
@@ -1188,7 +1188,7 @@ impl<'a> Parser<'a> {
1188
1188
fields. insert ( start_idx, Ident :: new ( symbol2, span2) ) ;
1189
1189
fields. insert ( start_idx, Ident :: new ( symbol1, span1) ) ;
1190
1190
}
1191
- DestructuredFloat :: Error => {
1191
+ DestructuredFloat :: Error ( _ ) => {
1192
1192
trailing_dot = None ;
1193
1193
fields. insert ( start_idx, Ident :: new ( symbol, self . prev_token . span ) ) ;
1194
1194
}
0 commit comments