From e29b5badbcf1d2f5e16bca00d067e07c18770f12 Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Sat, 19 Nov 2022 18:44:21 +0000 Subject: [PATCH] Fix mir interp of `TerminatorKind::Terminate` --- compiler/rustc_const_eval/src/interpret/terminator.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_const_eval/src/interpret/terminator.rs b/compiler/rustc_const_eval/src/interpret/terminator.rs index eef5518a1f8..a07702f7d9b 100644 --- a/compiler/rustc_const_eval/src/interpret/terminator.rs +++ b/compiler/rustc_const_eval/src/interpret/terminator.rs @@ -145,7 +145,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { } Terminate => { - M::abort(self, "the program aborted execution".to_owned())?; + // FIXME: maybe should call `panic_no_unwind` lang item instead. + M::abort(self, "panic in a function that cannot unwind".to_owned())?; } // When we encounter Resume, we've finished unwinding