Skip to content

Commit 62cf9ab

Browse files
committed
rename FrameInfo span field to call_site
1 parent b396505 commit 62cf9ab

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/librustc/ich/impls_ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ impl_stable_hash_for!(enum mir::interpret::ErrorHandled {
388388
});
389389

390390
impl_stable_hash_for!(struct mir::interpret::FrameInfo<'tcx> {
391-
span,
391+
call_site,
392392
lint_root,
393393
instance
394394
});

src/librustc/mir/interpret/error.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub struct ConstEvalErr<'tcx> {
5757

5858
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
5959
pub struct FrameInfo<'tcx> {
60-
pub span: Span,
60+
pub call_site: Span, // this span is in the caller!
6161
pub instance: ty::Instance<'tcx>,
6262
pub lint_root: Option<ast::NodeId>,
6363
}
@@ -72,8 +72,8 @@ impl<'tcx> fmt::Display for FrameInfo<'tcx> {
7272
} else {
7373
write!(f, "inside call to `{}`", self.instance)?;
7474
}
75-
if !self.span.is_dummy() {
76-
let lo = tcx.sess.source_map().lookup_char_pos_adj(self.span.lo());
75+
if !self.call_site.is_dummy() {
76+
let lo = tcx.sess.source_map().lookup_char_pos_adj(self.call_site.lo());
7777
write!(f, " at {}:{}:{}", lo.filename, lo.line, lo.col.to_usize() + 1)?;
7878
}
7979
Ok(())
@@ -159,7 +159,7 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
159159
// on constant values.
160160
if self.stacktrace.len() > 0 {
161161
for frame_info in &self.stacktrace[..self.stacktrace.len()-1] {
162-
err.span_label(frame_info.span, frame_info.to_string());
162+
err.span_label(frame_info.call_site, frame_info.to_string());
163163
}
164164
}
165165
Ok(err)

src/librustc_mir/interpret/eval_context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
679679
mir::ClearCrossCrate::Set(ref ivs) => Some(ivs[source_info.scope].lint_root),
680680
mir::ClearCrossCrate::Clear => None,
681681
};
682-
frames.push(FrameInfo { span, instance, lint_root });
682+
frames.push(FrameInfo { call_site: span, instance, lint_root });
683683
}
684684
trace!("generate stacktrace: {:#?}, {:?}", frames, explicit_span);
685685
frames

0 commit comments

Comments
 (0)