Skip to content

Commit

Permalink
rename FrameInfo span field to call_site
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 15, 2018
1 parent b396505 commit 62cf9ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/librustc/ich/impls_ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ impl_stable_hash_for!(enum mir::interpret::ErrorHandled {
});

impl_stable_hash_for!(struct mir::interpret::FrameInfo<'tcx> {
span,
call_site,
lint_root,
instance
});
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct ConstEvalErr<'tcx> {

#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
pub struct FrameInfo<'tcx> {
pub span: Span,
pub call_site: Span, // this span is in the caller!
pub instance: ty::Instance<'tcx>,
pub lint_root: Option<ast::NodeId>,
}
Expand All @@ -72,8 +72,8 @@ impl<'tcx> fmt::Display for FrameInfo<'tcx> {
} else {
write!(f, "inside call to `{}`", self.instance)?;
}
if !self.span.is_dummy() {
let lo = tcx.sess.source_map().lookup_char_pos_adj(self.span.lo());
if !self.call_site.is_dummy() {
let lo = tcx.sess.source_map().lookup_char_pos_adj(self.call_site.lo());
write!(f, " at {}:{}:{}", lo.filename, lo.line, lo.col.to_usize() + 1)?;
}
Ok(())
Expand Down Expand Up @@ -159,7 +159,7 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
// on constant values.
if self.stacktrace.len() > 0 {
for frame_info in &self.stacktrace[..self.stacktrace.len()-1] {
err.span_label(frame_info.span, frame_info.to_string());
err.span_label(frame_info.call_site, frame_info.to_string());
}
}
Ok(err)
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/interpret/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
mir::ClearCrossCrate::Set(ref ivs) => Some(ivs[source_info.scope].lint_root),
mir::ClearCrossCrate::Clear => None,
};
frames.push(FrameInfo { span, instance, lint_root });
frames.push(FrameInfo { call_site: span, instance, lint_root });
}
trace!("generate stacktrace: {:#?}, {:?}", frames, explicit_span);
frames
Expand Down

0 comments on commit 62cf9ab

Please sign in to comment.