Skip to content

Commit 0671d42

Browse files
author
The Miri Cronjob Bot
committed
Merge from rustc
2 parents 57266e9 + f36a5b9 commit 0671d42

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/shims/backtrace.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::*;
22
use rustc_ast::ast::Mutability;
33
use rustc_middle::ty::layout::LayoutOf as _;
44
use rustc_middle::ty::{self, Instance, Ty};
5-
use rustc_span::{BytePos, Loc, Symbol};
5+
use rustc_span::{hygiene, BytePos, Loc, Symbol};
66
use rustc_target::{abi::Size, spec::abi::Abi};
77

88
impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
@@ -45,12 +45,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
4545

4646
let mut data = Vec::new();
4747
for frame in this.active_thread_stack().iter().rev() {
48-
let mut span = frame.current_span();
49-
// Match the behavior of runtime backtrace spans
50-
// by using a non-macro span in our backtrace. See `FunctionCx::debug_loc`.
51-
if span.from_expansion() && !tcx.sess.opts.unstable_opts.debug_macros {
52-
span = rustc_span::hygiene::walk_chain(span, frame.body.span.ctxt())
53-
}
48+
// Match behavior of debuginfo (`FunctionCx::adjusted_span_and_dbg_scope`).
49+
let span = hygiene::walk_chain_collapsed(frame.current_span(), frame.body.span);
5450
data.push((frame.instance, span.lo()));
5551
}
5652

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$DIR/backtrace-api-v0.rs:24:14 (func_d)
2-
$DIR/backtrace-api-v0.rs:20:5 (func_c)
2+
$DIR/backtrace-api-v0.rs:14:9 (func_c)
33
$DIR/backtrace-api-v0.rs:9:5 (func_b::<u8>)
44
$DIR/backtrace-api-v0.rs:5:5 (func_a)
55
$DIR/backtrace-api-v0.rs:29:18 (main)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$DIR/backtrace-api-v1.rs:27:9 (func_d)
2-
$DIR/backtrace-api-v1.rs:20:5 (func_c)
2+
$DIR/backtrace-api-v1.rs:14:9 (func_c)
33
$DIR/backtrace-api-v1.rs:9:5 (func_b::<u8>)
44
$DIR/backtrace-api-v1.rs:5:5 (func_a)
55
$DIR/backtrace-api-v1.rs:34:18 (main)

0 commit comments

Comments
 (0)