Skip to content

Commit b15e752

Browse files
committed
adjust for span not being passed around any more
1 parent aa2645a commit b15e752

File tree

5 files changed

+7
-18
lines changed

5 files changed

+7
-18
lines changed

src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn report_msg<'tcx, 'mir>(
129129
err.help(help);
130130
}
131131
// Add backtrace
132-
let frames = ecx.generate_stacktrace(None);
132+
let frames = ecx.generate_stacktrace();
133133
for (idx, frame_info) in frames.iter().enumerate() {
134134
let is_local = frame_info.instance.def_id().is_local();
135135
// No span for non-local frames and the first frame (which is the error site).

src/helpers.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use rustc_middle::ty::{
1010
List, TyCtxt,
1111
};
1212
use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX};
13-
use rustc_span::source_map::DUMMY_SP;
1413

1514
use rand::RngCore;
1615

@@ -157,13 +156,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
157156

158157
// Push frame.
159158
let mir = &*this.load_mir(f.def, None)?;
160-
let span = this
161-
.stack()
162-
.last()
163-
.and_then(Frame::current_source_info)
164-
.map(|si| si.span)
165-
.unwrap_or(DUMMY_SP);
166-
this.push_stack_frame(f, span, mir, dest, stack_pop)?;
159+
this.push_stack_frame(f, mir, dest, stack_pop)?;
167160

168161
// Initialize arguments.
169162
let mut callee_args = this.frame().body.args_iter();

src/machine.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_middle::ty::{
1818
Ty,
1919
};
2020
use rustc_ast::attr;
21-
use rustc_span::{source_map::Span, symbol::{sym, Symbol}};
21+
use rustc_span::symbol::{sym, Symbol};
2222

2323
use crate::*;
2424

@@ -253,7 +253,6 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
253253
#[inline(always)]
254254
fn find_mir_or_eval_fn(
255255
ecx: &mut InterpCx<'mir, 'tcx, Self>,
256-
_span: Span,
257256
instance: ty::Instance<'tcx>,
258257
args: &[OpTy<'tcx, Tag>],
259258
ret: Option<(PlaceTy<'tcx, Tag>, mir::BasicBlock)>,
@@ -276,13 +275,12 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
276275
#[inline(always)]
277276
fn call_intrinsic(
278277
ecx: &mut rustc_mir::interpret::InterpCx<'mir, 'tcx, Self>,
279-
span: Span,
280278
instance: ty::Instance<'tcx>,
281279
args: &[OpTy<'tcx, Tag>],
282280
ret: Option<(PlaceTy<'tcx, Tag>, mir::BasicBlock)>,
283281
unwind: Option<mir::BasicBlock>,
284282
) -> InterpResult<'tcx> {
285-
ecx.call_intrinsic(span, instance, args, ret, unwind)
283+
ecx.call_intrinsic(instance, args, ret, unwind)
286284
}
287285

288286
#[inline(always)]

src/shims/intrinsics.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@ use rustc_middle::mir;
55
use rustc_middle::ty;
66
use rustc_middle::ty::layout::{Align, LayoutOf};
77
use rustc_apfloat::Float;
8-
use rustc_span::source_map::Span;
98

109
use crate::*;
1110

1211
impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}
1312
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> {
1413
fn call_intrinsic(
1514
&mut self,
16-
span: Span,
1715
instance: ty::Instance<'tcx>,
1816
args: &[OpTy<'tcx, Tag>],
1917
ret: Option<(PlaceTy<'tcx, Tag>, mir::BasicBlock)>,
2018
unwind: Option<mir::BasicBlock>,
2119
) -> InterpResult<'tcx> {
2220
let this = self.eval_context_mut();
23-
if this.emulate_intrinsic(span, instance, args, ret)? {
21+
if this.emulate_intrinsic(instance, args, ret)? {
2422
return Ok(());
2523
}
2624
let substs = instance.substs;

src/shims/panic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
5151
) -> InterpResult<'tcx> {
5252
let this = self.eval_context_mut();
5353

54-
trace!("miri_start_panic: {:?}", this.frame().span);
54+
trace!("miri_start_panic: {:?}", this.frame().instance);
5555

5656
// Get the raw pointer stored in arg[0] (the panic payload).
5757
let payload = this.read_scalar(args[0])?.not_undef()?;
@@ -133,7 +133,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
133133
if let (true, Some(catch_unwind)) = (unwinding, extra.catch_unwind.take()) {
134134
// We've just popped a frame that was pushed by `try`,
135135
// and we are unwinding, so we should catch that.
136-
trace!("unwinding: found catch_panic frame during unwinding: {:?}", this.frame().span);
136+
trace!("unwinding: found catch_panic frame during unwinding: {:?}", this.frame().instance);
137137

138138
// We set the return value of `try` to 1, since there was a panic.
139139
this.write_scalar(Scalar::from_i32(1), catch_unwind.dest)?;

0 commit comments

Comments
 (0)