interpret/miri: call panic_cannot_unwind lang item instead of hard-coding the same message
This commit is contained in:
@@ -223,6 +223,9 @@ pub trait Machine<'mir, 'tcx: 'mir>: Sized {
|
||||
throw_unsup_format!("aborting execution is not supported")
|
||||
}
|
||||
|
||||
/// Called when unwinding reached a state where execution should be terminated.
|
||||
fn unwind_terminate(_ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx>;
|
||||
|
||||
/// Called for all binary operations where the LHS has pointer type.
|
||||
///
|
||||
/// Returns a (value, overflowed) pair if the operation succeeded
|
||||
@@ -499,6 +502,11 @@ pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) {
|
||||
false
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn unwind_terminate(_ecx: &mut InterpCx<$mir, $tcx, Self>) -> InterpResult<$tcx> {
|
||||
unreachable!("unwinding cannot happen during compile-time evaluation")
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn call_extra_fn(
|
||||
_ecx: &mut InterpCx<$mir, $tcx, Self>,
|
||||
|
||||
Reference in New Issue
Block a user