@@ -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 > {
@@ -1070,7 +1070,7 @@ impl<'a> Parser<'a> {
1070
1070
self . mk_expr_tuple_field_access ( lo, ident1_span, base, sym1, None ) ;
1071
1071
self . mk_expr_tuple_field_access ( lo, ident2_span, base1, sym2, suffix)
1072
1072
}
1073
- DestructuredFloat :: Error => base,
1073
+ DestructuredFloat :: Error ( _ ) => base,
1074
1074
} )
1075
1075
}
1076
1076
_ => {
@@ -1080,7 +1080,7 @@ impl<'a> Parser<'a> {
1080
1080
}
1081
1081
}
1082
1082
1083
- fn error_unexpected_after_dot ( & self ) {
1083
+ fn error_unexpected_after_dot ( & self ) -> ErrorGuaranteed {
1084
1084
let actual = pprust:: token_to_string ( & self . token ) ;
1085
1085
let span = self . token . span ;
1086
1086
let sm = self . psess . source_map ( ) ;
@@ -1090,7 +1090,7 @@ impl<'a> Parser<'a> {
1090
1090
}
1091
1091
_ => ( span, actual) ,
1092
1092
} ;
1093
- self . dcx ( ) . emit_err ( errors:: UnexpectedTokenAfterDot { span, actual } ) ;
1093
+ self . dcx ( ) . emit_err ( errors:: UnexpectedTokenAfterDot { span, actual } )
1094
1094
}
1095
1095
1096
1096
// We need an identifier or integer, but the next token is a float.
@@ -1178,8 +1178,8 @@ impl<'a> Parser<'a> {
1178
1178
// 1.2e+3 | 1.2e-3
1179
1179
[ IdentLike ( _) , Punct ( '.' ) , IdentLike ( _) , Punct ( '+' | '-' ) , IdentLike ( _) ] => {
1180
1180
// See the FIXME about `TokenCursor` above.
1181
- self . error_unexpected_after_dot ( ) ;
1182
- DestructuredFloat :: Error
1181
+ let guar = self . error_unexpected_after_dot ( ) ;
1182
+ DestructuredFloat :: Error ( guar )
1183
1183
}
1184
1184
_ => panic ! ( "unexpected components in a float token: {components:?}" ) ,
1185
1185
}
@@ -1245,7 +1245,7 @@ impl<'a> Parser<'a> {
1245
1245
fields. insert ( start_idx, Ident :: new ( symbol2, span2) ) ;
1246
1246
fields. insert ( start_idx, Ident :: new ( symbol1, span1) ) ;
1247
1247
}
1248
- DestructuredFloat :: Error => {
1248
+ DestructuredFloat :: Error ( _ ) => {
1249
1249
trailing_dot = None ;
1250
1250
fields. insert ( start_idx, Ident :: new ( symbol, self . prev_token . span ) ) ;
1251
1251
}
0 commit comments