diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2018-10-19 14:23:20 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2018-10-21 15:49:19 +0200 |
| commit | 7d406c9146d5a33abcc5e2a105d8856c8c7057d5 (patch) | |
| tree | 77a42db95f9191920e19a17abba707f6555ad6f9 | |
| parent | 3e62ba1af6df5bd14fe210b9f20977e97bbae370 (diff) | |
| download | rust-7d406c9146d5a33abcc5e2a105d8856c8c7057d5.tar.gz rust-7d406c9146d5a33abcc5e2a105d8856c8c7057d5.zip | |
Fix errors
| -rw-r--r-- | src/librustc_mir/interpret/operand.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index 8d2190d22c0..f928997dde7 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -775,11 +775,13 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> /// This is used by [priroda](https://github.com/oli-obk/priroda) to get an OpTy from a local pub fn read_local_of_frame( &self, - frame: &super::Frame, + frame: &super::Frame<'mir, 'tcx>, local: mir::Local ) -> EvalResult<'tcx, OpTy<'tcx>> { - let op = frame.locals[local].access()?; - let layout = self.layout_of_local(frame, local)?; - OpTy { op, layout } + let op = *frame.locals[local].access()?; + let local_ty = frame.mir.local_decls[local].ty; + let local_ty = self.monomorphize(local_ty, frame.instance.substs); + let layout = self.layout_of(local_ty)?; + Ok(OpTy { op, layout }) } } |
