From b178553e555bd3634005878bcd90e2f8295289f6 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sun, 21 Oct 2018 16:16:23 +0200 Subject: [PATCH] Address review comments --- src/librustc_mir/interpret/operand.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index 744856c805c4..71b2f4b53a60 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -572,12 +572,15 @@ 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 + /// + /// When you know the layout of the local in advance, you can pass it as last argument pub fn access_local( &self, frame: &super::Frame<'mir, 'tcx, M::PointerTag>, local: mir::Local, layout: Option>, ) -> EvalResult<'tcx, OpTy<'tcx, M::PointerTag>> { + assert_ne!(local, mir::RETURN_PLACE); let op = *frame.locals[local].access()?; let layout = from_known_layout(layout, || self.layout_of_local(frame, local))?;