summaryrefslogtreecommitdiffstats
path: root/src/librustc_mir/interpret/step.rs
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2018-02-06 18:33:59 +0100
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2018-03-08 08:34:17 +0100
commit2f0e07730088b7656c244030f360406758f788ea (patch)
tree89709339baf13a5e24e1e08b478f24f324ccb239 /src/librustc_mir/interpret/step.rs
parentReport a best guess span if no stack is available anymore (diff)
downloadgrust-2f0e07730088b7656c244030f360406758f788ea.tar.gz
grust-2f0e07730088b7656c244030f360406758f788ea.tar.bz2
grust-2f0e07730088b7656c244030f360406758f788ea.tar.xz
Report tcx errors with the span of the currently evaluating statement
Diffstat (limited to 'src/librustc_mir/interpret/step.rs')
-rw-r--r--src/librustc_mir/interpret/step.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_mir/interpret/step.rs b/src/librustc_mir/interpret/step.rs
index 94fe3d1c67..54fd364d3f 100644
--- a/src/librustc_mir/interpret/step.rs
+++ b/src/librustc_mir/interpret/step.rs
@@ -51,6 +51,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
51 // Some statements (e.g. box) push new stack frames. We have to record the stack frame number 51 // Some statements (e.g. box) push new stack frames. We have to record the stack frame number
52 // *before* executing the statement. 52 // *before* executing the statement.
53 let frame_idx = self.cur_frame(); 53 let frame_idx = self.cur_frame();
54 self.tcx.span = stmt.source_info.span;
55 self.memory.tcx.span = stmt.source_info.span;
54 56
55 match stmt.kind { 57 match stmt.kind {
56 Assign(ref place, ref rvalue) => self.eval_rvalue_into_place(rvalue, place)?, 58 Assign(ref place, ref rvalue) => self.eval_rvalue_into_place(rvalue, place)?,
@@ -99,6 +101,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
99 101
100 fn terminator(&mut self, terminator: &mir::Terminator<'tcx>) -> EvalResult<'tcx> { 102 fn terminator(&mut self, terminator: &mir::Terminator<'tcx>) -> EvalResult<'tcx> {
101 trace!("{:?}", terminator.kind); 103 trace!("{:?}", terminator.kind);
104 self.tcx.span = terminator.source_info.span;
105 self.memory.tcx.span = terminator.source_info.span;
102 self.eval_terminator(terminator)?; 106 self.eval_terminator(terminator)?;
103 if !self.stack.is_empty() { 107 if !self.stack.is_empty() {
104 trace!("// {:?}", self.frame().block); 108 trace!("// {:?}", self.frame().block);