pub enum Place {
Local(SmolStr),
SelfMember(SmolStr),
Field(Box<Place>, SmolStr),
}Expand description
A narrowable place: a local/param, or a (shallow) dotted access rooted at a local or self.
Deliberately shallow — we narrow x, x.y, self.y but not arbitrary call results
(f().y), array indices (a[i].y), or anything whose identity isn’t stable under re-evaluation.
Shallowness is what keeps narrowing sound under mutation/aliasing (the 1.0 cut).
Variants§
Local(SmolStr)
A function local / parameter, by name (GDScript locals are function-scoped).
SelfMember(SmolStr)
self.member (or a bare member resolving through self).
Field(Box<Place>, SmolStr)
A field access on another place (x.y, self.y.z).
Implementations§
Source§impl Place
impl Place
Sourcepub fn of(body: &Body, id: ExprId) -> Option<Place>
pub fn of(body: &Body, id: ExprId) -> Option<Place>
Derive the place an expression denotes, or None for a non-narrowable expression.
Sourcepub fn invalidated_by(&self, assigned: &Place) -> bool
pub fn invalidated_by(&self, assigned: &Place) -> bool
Whether assigning to assigned may invalidate a narrowing of self. Conservative prefix
check: assigning x clears x and x.*; assigning x.y clears x.y and x.y.* (but not
x). I.e. assigned is an ancestor-or-equal of self.
Sourcepub fn dotted_key(&self) -> String
pub fn dotted_key(&self) -> String
The dotted access-path key for this place (x, self.field, a.b.c) — the format the
checker’s narrow_key produces, so the two agree when the checker consults a fact.
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> HashEqLike<&T> for T
impl<T> HashEqLike<&T> for T
Source§impl<T> HashEqLike<Cow<'_, T>> for T
impl<T> HashEqLike<Cow<'_, T>> for T
Source§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.