Skip to content

Commit

Permalink
Update panic machinery to match #[track_caller] changes.
Browse files Browse the repository at this point in the history
This gets miri's tests passing again with rust-lang/rust#67137.
  • Loading branch information
anp committed Jan 5, 2020
1 parent f3c267d commit 0a3f460
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
#[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)>,
Expand Down
5 changes: 1 addition & 4 deletions src/shims/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
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 },
)?;
Expand Down

0 comments on commit 0a3f460

Please sign in to comment.