mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 14:10:03 +03:00
Fix comments related to abort()
This commit is contained in:
@@ -333,6 +333,10 @@ fn assert_panic(
|
||||
Err(ConstEvalErrKind::AssertFailure(err).into())
|
||||
}
|
||||
|
||||
fn abort(_ecx: &mut InterpCx<'mir, 'tcx, Self>, msg: String) -> InterpResult<'tcx, !> {
|
||||
Err(ConstEvalErrKind::Abort(msg).into())
|
||||
}
|
||||
|
||||
fn ptr_to_int(_mem: &Memory<'mir, 'tcx, Self>, _ptr: Pointer) -> InterpResult<'tcx, u64> {
|
||||
Err(ConstEvalErrKind::NeedsRfc("pointer-to-integer cast".to_string()).into())
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ pub fn emulate_intrinsic(
|
||||
None => match intrinsic_name {
|
||||
sym::transmute => throw_ub_format!("transmuting to uninhabited type"),
|
||||
sym::unreachable => throw_ub!(Unreachable),
|
||||
sym::abort => M::abort(self, "aborted execution".to_owned())?,
|
||||
sym::abort => M::abort(self, "the program aborted execution".to_owned())?,
|
||||
// Unsupported diverging intrinsic.
|
||||
_ => return Ok(false),
|
||||
},
|
||||
|
||||
@@ -176,10 +176,8 @@ fn assert_panic(
|
||||
) -> InterpResult<'tcx>;
|
||||
|
||||
/// Called to evaluate `Abort` MIR terminator.
|
||||
fn abort(_ecx: &mut InterpCx<'mir, 'tcx, Self>, msg: String) -> InterpResult<'tcx, !> {
|
||||
use crate::const_eval::ConstEvalErrKind;
|
||||
|
||||
Err(ConstEvalErrKind::Abort(msg).into())
|
||||
fn abort(_ecx: &mut InterpCx<'mir, 'tcx, Self>, _msg: String) -> InterpResult<'tcx, !> {
|
||||
throw_unsup_format!("aborting execution is not supported")
|
||||
}
|
||||
|
||||
/// Called for all binary operations where the LHS has pointer type.
|
||||
|
||||
@@ -110,7 +110,7 @@ pub(super) fn eval_terminator(
|
||||
}
|
||||
|
||||
Abort => {
|
||||
M::abort(self, "aborted execution".to_owned())?;
|
||||
M::abort(self, "the program aborted execution".to_owned())?;
|
||||
}
|
||||
|
||||
// When we encounter Resume, we've finished unwinding
|
||||
|
||||
Reference in New Issue
Block a user