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§
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,
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