@@ -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 > {
@@ -1000,7 +1000,7 @@ impl<'a> Parser<'a> {
1000
1000
self . mk_expr_tuple_field_access ( lo, ident1_span, base, sym1, None ) ;
1001
1001
self . mk_expr_tuple_field_access ( lo, ident2_span, base1, sym2, suffix)
1002
1002
}
1003
- DestructuredFloat :: Error => base,
1003
+ DestructuredFloat :: Error ( _ ) => base,
1004
1004
} )
1005
1005
}
1006
1006
_ => {
@@ -1010,7 +1010,7 @@ impl<'a> Parser<'a> {
1010
1010
}
1011
1011
}
1012
1012
1013
- fn error_unexpected_after_dot ( & self ) {
1013
+ fn error_unexpected_after_dot ( & self ) -> ErrorGuaranteed {
1014
1014
let actual = pprust:: token_to_string ( & self . token ) ;
1015
1015
let span = self . token . span ;
1016
1016
let sm = self . psess . source_map ( ) ;
@@ -1020,7 +1020,7 @@ impl<'a> Parser<'a> {
1020
1020
}
1021
1021
_ => ( span, actual) ,
1022
1022
} ;
1023
- self . dcx ( ) . emit_err ( errors:: UnexpectedTokenAfterDot { span, actual } ) ;
1023
+ self . dcx ( ) . emit_err ( errors:: UnexpectedTokenAfterDot { span, actual } )
1024
1024
}
1025
1025
1026
1026
// We need an identifier or integer, but the next token is a float.
@@ -1108,8 +1108,8 @@ impl<'a> Parser<'a> {
1108
1108
// 1.2e+3 | 1.2e-3
1109
1109
[ IdentLike ( _) , Punct ( '.' ) , IdentLike ( _) , Punct ( '+' | '-' ) , IdentLike ( _) ] => {
1110
1110
// See the FIXME about `TokenCursor` above.
1111
- self . error_unexpected_after_dot ( ) ;
1112
- DestructuredFloat :: Error
1111
+ let guar = self . error_unexpected_after_dot ( ) ;
1112
+ DestructuredFloat :: Error ( guar )
1113
1113
}
1114
1114
_ => panic ! ( "unexpected components in a float token: {components:?}" ) ,
1115
1115
}
@@ -1175,7 +1175,7 @@ impl<'a> Parser<'a> {
1175
1175
fields. insert ( start_idx, Ident :: new ( symbol2, span2) ) ;
1176
1176
fields. insert ( start_idx, Ident :: new ( symbol1, span1) ) ;
1177
1177
}
1178
- DestructuredFloat :: Error => {
1178
+ DestructuredFloat :: Error ( _ ) => {
1179
1179
trailing_dot = None ;
1180
1180
fields. insert ( start_idx, Ident :: new ( symbol, self . prev_token . span ) ) ;
1181
1181
}
0 commit comments