diff options
| author | Bruno Dutra <brunocodutra@gmail.com> | 2018-08-30 21:58:28 +0200 |
|---|---|---|
| committer | Bruno Dutra <brunocodutra@gmail.com> | 2018-09-03 20:02:35 +0200 |
| commit | a26ceb3be4e771799b58383116f4d70f15e7c937 (patch) | |
| tree | 2821d22bca05d1bc345d37b415384938ebec83f5 | |
| parent | add9ee24db86ea25a286fbd604f1ba8aadf90969 (diff) | |
| download | rust-a26ceb3be4e771799b58383116f4d70f15e7c937.tar.gz rust-a26ceb3be4e771799b58383116f4d70f15e7c937.zip | |
Use EvalContext's TyCtx for the purpose of hashing the evaluation context
| -rw-r--r-- | src/librustc_mir/interpret/eval_context.rs | 3 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/step.rs | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index ac34de490bb..bc03ef8c025 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -227,12 +227,13 @@ impl<'a, 'mir, 'tcx, M> InfiniteLoopDetector<'a, 'mir, 'tcx, M> pub fn observe_and_analyze( &mut self, + tcx: &TyCtxt<'b, 'tcx, 'tcx>, machine: &M, memory: &Memory<'a, 'mir, 'tcx, M>, stack: &[Frame<'mir, 'tcx>], ) -> EvalResult<'tcx, ()> { - let mut hcx = memory.tcx.get_stable_hashing_context(); + let mut hcx = tcx.get_stable_hashing_context(); let mut hasher = StableHasher::<u64>::new(); (machine, stack).hash_stable(&mut hcx, &mut hasher); let hash = hasher.finish(); diff --git a/src/librustc_mir/interpret/step.rs b/src/librustc_mir/interpret/step.rs index f3d655c2651..545333e8791 100644 --- a/src/librustc_mir/interpret/step.rs +++ b/src/librustc_mir/interpret/step.rs @@ -73,7 +73,12 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> { "Constant evaluating a complex constant, this might take some time"); } - self.loop_detector.observe_and_analyze(&self.machine, &self.memory, &self.stack[..]) + self.loop_detector.observe_and_analyze( + &self.tcx, + &self.machine, + &self.memory, + &self.stack[..], + ) } pub fn run(&mut self) -> EvalResult<'tcx> { |
