mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 13:06:28 +03:00
Update panic machinery to match #[track_caller] changes.
This gets miri's tests passing again with https://github.com/rust-lang/rust/pull/67137.
This commit is contained in:
@@ -182,6 +182,7 @@ fn enforce_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
|
||||
#[inline(always)]
|
||||
fn find_mir_or_eval_fn(
|
||||
ecx: &mut InterpCx<'mir, 'tcx, Self>,
|
||||
_span: Span,
|
||||
instance: ty::Instance<'tcx>,
|
||||
args: &[OpTy<'tcx, Tag>],
|
||||
ret: Option<(PlaceTy<'tcx, Tag>, mir::BasicBlock)>,
|
||||
|
||||
+1
-4
@@ -187,15 +187,12 @@ fn assert_panic(
|
||||
let msg = msg.description();
|
||||
let msg = this.allocate_str(msg, MiriMemoryKind::Env.into());
|
||||
|
||||
// Second arg: Caller location.
|
||||
let location = this.alloc_caller_location_for_span(span);
|
||||
|
||||
// Call the lang item.
|
||||
let panic = this.tcx.lang_items().panic_fn().unwrap();
|
||||
let panic = ty::Instance::mono(this.tcx.tcx, panic);
|
||||
this.call_function(
|
||||
panic,
|
||||
&[msg.to_ref(), location.ptr.into()],
|
||||
&[msg.to_ref()],
|
||||
None,
|
||||
StackPopCleanup::Goto { ret: None, unwind },
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user