pub enum Place {
Local(SlotId),
Field(Box<Place>, FieldIdx),
Index(Box<Place>, Box<Operand>),
Deref(Box<Place>),
}Expand description
A place is something that can be borrowed or assigned to. Tracks granular access paths for disjoint borrow analysis.
Variants§
Local(SlotId)
A local variable: x
Field(Box<Place>, FieldIdx)
A field of a place: x.field_name
Index(Box<Place>, Box<Operand>)
An index into a place: x[i] — index analysis is conservative in v1.
The index operand is boxed to break the recursive type cycle (Place → Operand → Place).
Deref(Box<Place>)
Dereferencing a reference: *r
Implementations§
Source§impl Place
impl Place
Sourcepub fn root_local(&self) -> SlotId
pub fn root_local(&self) -> SlotId
Get the root local of this place (e.g., x.a.b → x).
Sourcepub fn is_prefix_of(&self, other: &Place) -> bool
pub fn is_prefix_of(&self, other: &Place) -> bool
Check if this place is a prefix of another (for conflict detection).
x is a prefix of x.a, x is a prefix of x[i], etc.
Sourcepub fn conflicts_with(&self, other: &Place) -> bool
pub fn conflicts_with(&self, other: &Place) -> bool
Check whether two places conflict (one borrows/writes something the other uses). Two places conflict if one is a prefix of the other, or they’re the same. In v1, disjoint field borrows are tracked (x.a and x.b don’t conflict), but index borrows are conservative (x[i] and x[j] always conflict).
Sourcepub fn projection_steps(&self) -> Vec<ProjectionStep>
pub fn projection_steps(&self) -> Vec<ProjectionStep>
Return a normalized projection summary from the root local to this place.
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.