mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
Address review comments
This commit is contained in:
parent
c32cf25689
commit
b178553e55
@ -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
|
/// 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(
|
pub fn access_local(
|
||||||
&self,
|
&self,
|
||||||
frame: &super::Frame<'mir, 'tcx, M::PointerTag>,
|
frame: &super::Frame<'mir, 'tcx, M::PointerTag>,
|
||||||
local: mir::Local,
|
local: mir::Local,
|
||||||
layout: Option<TyLayout<'tcx>>,
|
layout: Option<TyLayout<'tcx>>,
|
||||||
) -> EvalResult<'tcx, OpTy<'tcx, M::PointerTag>> {
|
) -> EvalResult<'tcx, OpTy<'tcx, M::PointerTag>> {
|
||||||
|
assert_ne!(local, mir::RETURN_PLACE);
|
||||||
let op = *frame.locals[local].access()?;
|
let op = *frame.locals[local].access()?;
|
||||||
let layout = from_known_layout(layout,
|
let layout = from_known_layout(layout,
|
||||||
|| self.layout_of_local(frame, local))?;
|
|| self.layout_of_local(frame, local))?;
|
||||||
|
Loading…
Reference in New Issue
Block a user