Struct stable_mir::mir::body::Place
source · pub struct Place {
pub local: Local,
pub projection: Vec<ProjectionElem>,
}
Fields§
§local: Local
§projection: Vec<ProjectionElem>
projection out of a place (access a field, deref a pointer, etc)
Implementations§
source§impl Place
impl Place
sourcepub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error>
pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error>
Resolve down the chain of projections to get the type referenced at the end of it.
E.g.:
Calling ty()
on var.field
should return the type of field
.
In order to retrieve the correct type, the locals
argument must match the list of all
locals from the function body where this place originates from.
Trait Implementations§
source§impl PartialEq for Place
impl PartialEq for Place
impl Eq for Place
impl StructuralPartialEq for Place
Auto Trait Implementations§
impl Freeze for Place
impl RefUnwindSafe for Place
impl Send for Place
impl Sync for Place
impl Unpin for Place
impl UnwindSafe for Place
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes