@@ -49,7 +49,7 @@ enum DestructuredFloat {
49
49
/// 1.2 | 1.2e3
50
50
MiddleDot ( Symbol , Span , Span , Symbol , Span ) ,
51
51
/// Invalid
52
- Error ,
52
+ Error ( ErrorGuaranteed ) ,
53
53
}
54
54
55
55
impl < ' a > Parser < ' a > {
@@ -1008,7 +1008,7 @@ impl<'a> Parser<'a> {
1008
1008
self . mk_expr_tuple_field_access ( lo, ident1_span, base, sym1, None ) ;
1009
1009
self . mk_expr_tuple_field_access ( lo, ident2_span, base1, sym2, suffix)
1010
1010
}
1011
- DestructuredFloat :: Error => base,
1011
+ DestructuredFloat :: Error ( _ ) => base,
1012
1012
} )
1013
1013
}
1014
1014
_ => {
@@ -1018,7 +1018,7 @@ impl<'a> Parser<'a> {
1018
1018
}
1019
1019
}
1020
1020
1021
- fn error_unexpected_after_dot ( & self ) {
1021
+ fn error_unexpected_after_dot ( & self ) -> ErrorGuaranteed {
1022
1022
let actual = pprust:: token_to_string ( & self . token ) ;
1023
1023
let span = self . token . span ;
1024
1024
let sm = self . psess . source_map ( ) ;
@@ -1028,7 +1028,7 @@ impl<'a> Parser<'a> {
1028
1028
}
1029
1029
_ => ( span, actual) ,
1030
1030
} ;
1031
- self . dcx ( ) . emit_err ( errors:: UnexpectedTokenAfterDot { span, actual } ) ;
1031
+ self . dcx ( ) . emit_err ( errors:: UnexpectedTokenAfterDot { span, actual } )
1032
1032
}
1033
1033
1034
1034
// We need an identifier or integer, but the next token is a float.
@@ -1116,8 +1116,8 @@ impl<'a> Parser<'a> {
1116
1116
// 1.2e+3 | 1.2e-3
1117
1117
[ IdentLike ( _) , Punct ( '.' ) , IdentLike ( _) , Punct ( '+' | '-' ) , IdentLike ( _) ] => {
1118
1118
// See the FIXME about `TokenCursor` above.
1119
- self . error_unexpected_after_dot ( ) ;
1120
- DestructuredFloat :: Error
1119
+ let guar = self . error_unexpected_after_dot ( ) ;
1120
+ DestructuredFloat :: Error ( guar )
1121
1121
}
1122
1122
_ => panic ! ( "unexpected components in a float token: {components:?}" ) ,
1123
1123
}
@@ -1183,7 +1183,7 @@ impl<'a> Parser<'a> {
1183
1183
fields. insert ( start_idx, Ident :: new ( symbol2, span2) ) ;
1184
1184
fields. insert ( start_idx, Ident :: new ( symbol1, span1) ) ;
1185
1185
}
1186
- DestructuredFloat :: Error => {
1186
+ DestructuredFloat :: Error ( _ ) => {
1187
1187
trailing_dot = None ;
1188
1188
fields. insert ( start_idx, Ident :: new ( symbol, self . prev_token . span ) ) ;
1189
1189
}
0 commit comments