Skip to content

Commit b178553

Browse files
committed
Address review comments
1 parent c32cf25 commit b178553

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc_mir/interpret/operand.rs

+3
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,15 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
572572
}
573573

574574
/// This is used by [priroda](https://github.com/oli-obk/priroda) to get an OpTy from a local
575+
///
576+
/// When you know the layout of the local in advance, you can pass it as last argument
575577
pub fn access_local(
576578
&self,
577579
frame: &super::Frame<'mir, 'tcx, M::PointerTag>,
578580
local: mir::Local,
579581
layout: Option<TyLayout<'tcx>>,
580582
) -> EvalResult<'tcx, OpTy<'tcx, M::PointerTag>> {
583+
assert_ne!(local, mir::RETURN_PLACE);
581584
let op = *frame.locals[local].access()?;
582585
let layout = from_known_layout(layout,
583586
|| self.layout_of_local(frame, local))?;

0 commit comments

Comments
 (0)