diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-27 00:40:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-27 00:40:01 +0100 |
| commit | ec5c5b7da8822122325d45625b9978fd3f05d84f (patch) | |
| tree | 990240c78357b03678f3ed4608f0dc8a5e290184 /compiler/rustc_parse/src/parser | |
| parent | 94609dbb031c6538080488d21423a1190160ec23 (diff) | |
| parent | 1658ca082a1d510480a7c228b0b6bfb83863d0e9 (diff) | |
| download | rust-ec5c5b7da8822122325d45625b9978fd3f05d84f.tar.gz rust-ec5c5b7da8822122325d45625b9978fd3f05d84f.zip | |
Rollup merge of #121651 - ShE3py:issue-121647, r=estebank
Properly emit `expected ;` on `#[attr] expr` Fixes #121647 See #118182, #120586 --- r? estebank
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 |
