about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src
diff options
context:
space:
mode:
authorLieselotte <52315535+she3py@users.noreply.github.com>2024-02-25 22:22:11 +0100
committerLieselotte <52315535+she3py@users.noreply.github.com>2024-02-25 22:24:31 +0100
commitc440a5b814005c85ec903f9b9e44e25bf5c9c565 (patch)
treeb1d4d9004e25f842949a6348a4e4269dd2a840c9 /compiler/rustc_ast_lowering/src
parenta3fce72a27ee41077c3752851ff778f886f0a4fa (diff)
downloadrust-c440a5b814005c85ec903f9b9e44e25bf5c9c565.tar.gz
rust-c440a5b814005c85ec903f9b9e44e25bf5c9c565.zip
Add `ErrorGuaranteed` to `ast::ExprKind::Err`
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
-rw-r--r--compiler/rustc_ast_lowering/src/expr.rs4
-rw-r--r--compiler/rustc_ast_lowering/src/pat.rs2
2 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs
index 5d33a7a9142..9950db4784b 100644
--- a/compiler/rustc_ast_lowering/src/expr.rs
+++ b/compiler/rustc_ast_lowering/src/expr.rs
@@ -329,9 +329,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
                     )
                 }
                 ExprKind::Yield(opt_expr) => self.lower_expr_yield(e.span, opt_expr.as_deref()),
-                ExprKind::Err => {
-                    hir::ExprKind::Err(self.dcx().span_delayed_bug(e.span, "lowered ExprKind::Err"))
-                }
+                ExprKind::Err(guar) => hir::ExprKind::Err(*guar),
 
                 ExprKind::Dummy => {
                     span_bug!(e.span, "lowered ExprKind::Dummy")
diff --git a/compiler/rustc_ast_lowering/src/pat.rs b/compiler/rustc_ast_lowering/src/pat.rs
index 755b073b2c3..469cdac11e4 100644
--- a/compiler/rustc_ast_lowering/src/pat.rs
+++ b/compiler/rustc_ast_lowering/src/pat.rs
@@ -331,7 +331,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
             ExprKind::Lit(..)
             | ExprKind::ConstBlock(..)
             | ExprKind::IncludedBytes(..)
-            | ExprKind::Err
+            | ExprKind::Err(_)
             | ExprKind::Dummy => {}
             ExprKind::Path(..) if allow_paths => {}
             ExprKind::Unary(UnOp::Neg, inner) if matches!(inner.kind, ExprKind::Lit(_)) => {}