about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-02-09 00:40:43 +0000
committerMichael Goulet <michael@errs.io>2024-02-09 00:40:43 +0000
commite32c1ddc5274636c03697f180224f4fa6721f200 (patch)
treeda32a981adee438d24e24e2b39dd1db64cc083c8 /compiler/rustc_const_eval/src
parent698a3c7adeed1213e1c3af73158566a85795a3c2 (diff)
downloadrust-e32c1ddc5274636c03697f180224f4fa6721f200.tar.gz
rust-e32c1ddc5274636c03697f180224f4fa6721f200.zip
Don't ice in validation when error body is created
Diffstat (limited to 'compiler/rustc_const_eval/src')
-rw-r--r--compiler/rustc_const_eval/src/transform/validate.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs
index c4542aaa7b2..3b7b502d3d0 100644
--- a/compiler/rustc_const_eval/src/transform/validate.rs
+++ b/compiler/rustc_const_eval/src/transform/validate.rs
@@ -60,6 +60,8 @@ impl<'tcx> MirPass<'tcx> for Validator {
                 ty::Closure(..) => Abi::RustCall,
                 ty::CoroutineClosure(..) => Abi::RustCall,
                 ty::Coroutine(..) => Abi::Rust,
+                // No need to do MIR validation on error bodies
+                ty::Error(_) => return,
                 _ => {
                     span_bug!(body.span, "unexpected body ty: {:?} phase {:?}", body_ty, mir_phase)
                 }