@@ -102,7 +102,7 @@ enum DestructuredFloat {
102
102
/// 1.2 | 1.2e3
103
103
MiddleDot ( Symbol , Span , Span , Symbol , Span ) ,
104
104
/// Invalid
105
- Error ,
105
+ Error ( ErrorGuaranteed ) ,
106
106
}
107
107
108
108
impl < ' a > Parser < ' a > {
@@ -1048,7 +1048,7 @@ impl<'a> Parser<'a> {
1048
1048
self . mk_expr_tuple_field_access ( lo, ident1_span, base, sym1, None ) ;
1049
1049
self . mk_expr_tuple_field_access ( lo, ident2_span, base1, sym2, suffix)
1050
1050
}
1051
- DestructuredFloat :: Error => base,
1051
+ DestructuredFloat :: Error ( _ ) => base,
1052
1052
} )
1053
1053
}
1054
1054
_ => {
@@ -1058,7 +1058,7 @@ impl<'a> Parser<'a> {
1058
1058
}
1059
1059
}
1060
1060
1061
- fn error_unexpected_after_dot ( & self ) {
1061
+ fn error_unexpected_after_dot ( & self ) -> ErrorGuaranteed {
1062
1062
let actual = pprust:: token_to_string ( & self . token ) ;
1063
1063
let span = self . token . span ;
1064
1064
let sm = self . psess . source_map ( ) ;
@@ -1068,7 +1068,7 @@ impl<'a> Parser<'a> {
1068
1068
}
1069
1069
_ => ( span, actual) ,
1070
1070
} ;
1071
- self . dcx ( ) . emit_err ( errors:: UnexpectedTokenAfterDot { span, actual } ) ;
1071
+ self . dcx ( ) . emit_err ( errors:: UnexpectedTokenAfterDot { span, actual } )
1072
1072
}
1073
1073
1074
1074
// We need an identifier or integer, but the next token is a float.
@@ -1156,8 +1156,8 @@ impl<'a> Parser<'a> {
1156
1156
// 1.2e+3 | 1.2e-3
1157
1157
[ IdentLike ( _) , Punct ( '.' ) , IdentLike ( _) , Punct ( '+' | '-' ) , IdentLike ( _) ] => {
1158
1158
// See the FIXME about `TokenCursor` above.
1159
- self . error_unexpected_after_dot ( ) ;
1160
- DestructuredFloat :: Error
1159
+ let guar = self . error_unexpected_after_dot ( ) ;
1160
+ DestructuredFloat :: Error ( guar )
1161
1161
}
1162
1162
_ => panic ! ( "unexpected components in a float token: {components:?}" ) ,
1163
1163
}
@@ -1223,7 +1223,7 @@ impl<'a> Parser<'a> {
1223
1223
fields. insert ( start_idx, Ident :: new ( symbol2, span2) ) ;
1224
1224
fields. insert ( start_idx, Ident :: new ( symbol1, span1) ) ;
1225
1225
}
1226
- DestructuredFloat :: Error => {
1226
+ DestructuredFloat :: Error ( _ ) => {
1227
1227
trailing_dot = None ;
1228
1228
fields. insert ( start_idx, Ident :: new ( symbol, self . prev_token . span ) ) ;
1229
1229
}
0 commit comments