Skip to content

Commit 03159d4

Browse files
committed
Remove ErrorGuaranteed retval from error_unexpected_after_dot.
It was added in #130349, but it's not used meaningfully, and causes difficulties for Nonterminal removal in #124141.
1 parent cee88f7 commit 03159d4

File tree

1 file changed

+7
-7
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+7
-7
lines changed

compiler/rustc_parse/src/parser/expr.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub(super) enum DestructuredFloat {
4949
/// 1.2 | 1.2e3
5050
MiddleDot(Symbol, Span, Span, Symbol, Span),
5151
/// Invalid
52-
Error(ErrorGuaranteed),
52+
Error,
5353
}
5454

5555
impl<'a> Parser<'a> {
@@ -1005,7 +1005,7 @@ impl<'a> Parser<'a> {
10051005
self.mk_expr_tuple_field_access(lo, ident1_span, base, sym1, None);
10061006
self.mk_expr_tuple_field_access(lo, ident2_span, base1, sym2, suffix)
10071007
}
1008-
DestructuredFloat::Error(_) => base,
1008+
DestructuredFloat::Error => base,
10091009
})
10101010
}
10111011
_ => {
@@ -1015,7 +1015,7 @@ impl<'a> Parser<'a> {
10151015
}
10161016
}
10171017

1018-
fn error_unexpected_after_dot(&self) -> ErrorGuaranteed {
1018+
fn error_unexpected_after_dot(&self) {
10191019
let actual = pprust::token_to_string(&self.token);
10201020
let span = self.token.span;
10211021
let sm = self.psess.source_map();
@@ -1025,7 +1025,7 @@ impl<'a> Parser<'a> {
10251025
}
10261026
_ => (span, actual),
10271027
};
1028-
self.dcx().emit_err(errors::UnexpectedTokenAfterDot { span, actual })
1028+
self.dcx().emit_err(errors::UnexpectedTokenAfterDot { span, actual });
10291029
}
10301030

10311031
/// We need an identifier or integer, but the next token is a float.
@@ -1111,8 +1111,8 @@ impl<'a> Parser<'a> {
11111111
// 1.2e+3 | 1.2e-3
11121112
[IdentLike(_), Punct('.'), IdentLike(_), Punct('+' | '-'), IdentLike(_)] => {
11131113
// See the FIXME about `TokenCursor` above.
1114-
let guar = self.error_unexpected_after_dot();
1115-
DestructuredFloat::Error(guar)
1114+
self.error_unexpected_after_dot();
1115+
DestructuredFloat::Error
11161116
}
11171117
_ => panic!("unexpected components in a float token: {components:?}"),
11181118
}
@@ -1178,7 +1178,7 @@ impl<'a> Parser<'a> {
11781178
fields.insert(start_idx, Ident::new(symbol2, span2));
11791179
fields.insert(start_idx, Ident::new(symbol1, span1));
11801180
}
1181-
DestructuredFloat::Error(_) => {
1181+
DestructuredFloat::Error => {
11821182
trailing_dot = None;
11831183
fields.insert(start_idx, Ident::new(symbol, self.prev_token.span));
11841184
}

0 commit comments

Comments
 (0)