adjust for span not being passed around any more
This commit is contained in:
parent
5130aa55a2
commit
f599687f3f
@ -129,7 +129,7 @@ fn report_msg<'tcx, 'mir>(
|
||||
err.help(help);
|
||||
}
|
||||
// Add backtrace
|
||||
let frames = ecx.generate_stacktrace(None);
|
||||
let frames = ecx.generate_stacktrace();
|
||||
for (idx, frame_info) in frames.iter().enumerate() {
|
||||
let is_local = frame_info.instance.def_id().is_local();
|
||||
// No span for non-local frames and the first frame (which is the error site).
|
||||
|
@ -10,7 +10,6 @@ use rustc_middle::ty::{
|
||||
List, TyCtxt,
|
||||
};
|
||||
use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX};
|
||||
use rustc_span::source_map::DUMMY_SP;
|
||||
|
||||
use rand::RngCore;
|
||||
|
||||
@ -170,13 +169,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
|
||||
// Push frame.
|
||||
let mir = &*this.load_mir(f.def, None)?;
|
||||
let span = this
|
||||
.stack()
|
||||
.last()
|
||||
.and_then(Frame::current_source_info)
|
||||
.map(|si| si.span)
|
||||
.unwrap_or(DUMMY_SP);
|
||||
this.push_stack_frame(f, span, mir, dest, stack_pop)?;
|
||||
this.push_stack_frame(f, mir, dest, stack_pop)?;
|
||||
|
||||
// Initialize arguments.
|
||||
let mut callee_args = this.frame().body.args_iter();
|
||||
|
@ -18,7 +18,7 @@ use rustc_middle::ty::{
|
||||
Ty,
|
||||
};
|
||||
use rustc_ast::attr;
|
||||
use rustc_span::{source_map::Span, symbol::{sym, Symbol}};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
|
||||
use crate::*;
|
||||
|
||||
@ -253,7 +253,6 @@ 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)>,
|
||||
@ -276,13 +275,12 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
|
||||
#[inline(always)]
|
||||
fn call_intrinsic(
|
||||
ecx: &mut rustc_mir::interpret::InterpCx<'mir, 'tcx, Self>,
|
||||
span: Span,
|
||||
instance: ty::Instance<'tcx>,
|
||||
args: &[OpTy<'tcx, Tag>],
|
||||
ret: Option<(PlaceTy<'tcx, Tag>, mir::BasicBlock)>,
|
||||
unwind: Option<mir::BasicBlock>,
|
||||
) -> InterpResult<'tcx> {
|
||||
ecx.call_intrinsic(span, instance, args, ret, unwind)
|
||||
ecx.call_intrinsic(instance, args, ret, unwind)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
@ -5,7 +5,6 @@ use rustc_middle::mir;
|
||||
use rustc_middle::ty;
|
||||
use rustc_middle::ty::layout::{Align, LayoutOf};
|
||||
use rustc_apfloat::Float;
|
||||
use rustc_span::source_map::Span;
|
||||
|
||||
use crate::*;
|
||||
|
||||
@ -13,14 +12,13 @@ impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tc
|
||||
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> {
|
||||
fn call_intrinsic(
|
||||
&mut self,
|
||||
span: Span,
|
||||
instance: ty::Instance<'tcx>,
|
||||
args: &[OpTy<'tcx, Tag>],
|
||||
ret: Option<(PlaceTy<'tcx, Tag>, mir::BasicBlock)>,
|
||||
unwind: Option<mir::BasicBlock>,
|
||||
) -> InterpResult<'tcx> {
|
||||
let this = self.eval_context_mut();
|
||||
if this.emulate_intrinsic(span, instance, args, ret)? {
|
||||
if this.emulate_intrinsic(instance, args, ret)? {
|
||||
return Ok(());
|
||||
}
|
||||
let substs = instance.substs;
|
||||
|
@ -51,7 +51,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
) -> InterpResult<'tcx> {
|
||||
let this = self.eval_context_mut();
|
||||
|
||||
trace!("miri_start_panic: {:?}", this.frame().span);
|
||||
trace!("miri_start_panic: {:?}", this.frame().instance);
|
||||
|
||||
// Get the raw pointer stored in arg[0] (the panic payload).
|
||||
let payload = this.read_scalar(args[0])?.not_undef()?;
|
||||
@ -133,7 +133,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
if let (true, Some(catch_unwind)) = (unwinding, extra.catch_unwind.take()) {
|
||||
// We've just popped a frame that was pushed by `try`,
|
||||
// and we are unwinding, so we should catch that.
|
||||
trace!("unwinding: found catch_panic frame during unwinding: {:?}", this.frame().span);
|
||||
trace!("unwinding: found catch_panic frame during unwinding: {:?}", this.frame().instance);
|
||||
|
||||
// We set the return value of `try` to 1, since there was a panic.
|
||||
this.write_scalar(Scalar::from_i32(1), catch_unwind.dest)?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user