diff options
| author | Lieselotte <52315535+she3py@users.noreply.github.com> | 2024-02-26 21:47:10 +0100 |
|---|---|---|
| committer | Lieselotte <52315535+she3py@users.noreply.github.com> | 2024-02-26 21:47:10 +0100 |
| commit | 1658ca082a1d510480a7c228b0b6bfb83863d0e9 (patch) | |
| tree | abb0f2ae4b5649622cd3bc0dff437316562be279 /compiler/rustc_parse/src/parser | |
| parent | 829308e9af1a1f55540d2c8b0e007e1d0cb9c8c6 (diff) | |
Properly emit `expected ;` on `#[attr] expr`
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index cc1f7c8ac7d..995e140b329 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -800,9 +800,8 @@ impl<'a> Parser<'a> { { Ok(next_attr) => next_attr, Err(inner_err) => { - err.cancel(); inner_err.cancel(); - return self.dcx().span_delayed_bug(expr.span, "not a tail expression"); + return err.emit(); } } && let ast::AttrKind::Normal(next_attr_kind) = next_attr.kind @@ -813,9 +812,8 @@ impl<'a> Parser<'a> { let next_expr = match snapshot.parse_expr() { Ok(next_expr) => next_expr, Err(inner_err) => { - err.cancel(); inner_err.cancel(); - return self.dcx().span_delayed_bug(expr.span, "not a tail expression"); + return err.emit(); } }; // We have for sure |
