struct ExpressionOnlyStore {
exprs: Arena<Expr>,
pats: Arena<Pat>,
bindings: Arena<Binding>,
labels: Arena<Label>,
binding_owners: FxHashMap<BindingId, ExprId>,
block_scopes: Box<[BlockId]>,
ident_hygiene: FxHashMap<ExprOrPatIdPacked, HygieneId>,
expr_roots: SmallVec<[ExprRoot; 1]>,
}Fields§
§exprs: Arena<Expr>§pats: Arena<Pat>§bindings: Arena<Binding>§labels: Arena<Label>§binding_owners: FxHashMap<BindingId, ExprId>Id of the closure/coroutine/anon const that owns the corresponding binding. If a binding is owned by the top level expression, it will not be listed in here.
block_scopes: Box<[BlockId]>Block expressions in this store that may contain inner items.
ident_hygiene: FxHashMap<ExprOrPatIdPacked, HygieneId>A map from an variable usages to their hygiene ID.
Expressions (and destructuring patterns) that can be recorded here are single segment path, although not all single segments path refer to variables and have hygiene (some refer to items, we don’t know at this stage).
expr_roots: SmallVec<[ExprRoot; 1]>Maps expression roots to their origin.
Note: while every root expr is an inference root (aka. an AnonConst), there could be other roots that do not appear here.
This can happen when anon consts are nested, for example:
[
();
{
// this repeat expr is anon const #1, and *only it* appears in this list.
[
();
{
// this repeat expr is anon const #2.
0
}
];
0
}
]We do this because this allows us to search this list using a binary search,
and it does not bother us because we use this list for two things: constructing ExprScopes, which
works fine with nested exprs, and retrieving inference results, and we copy the inner const’s inference
into the outer const.
Trait Implementations§
Source§impl Clone for ExpressionOnlyStore
impl Clone for ExpressionOnlyStore
Source§fn clone(&self) -> ExpressionOnlyStore
fn clone(&self) -> ExpressionOnlyStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExpressionOnlyStore
impl Debug for ExpressionOnlyStore
impl Eq for ExpressionOnlyStore
Source§impl PartialEq for ExpressionOnlyStore
impl PartialEq for ExpressionOnlyStore
impl StructuralPartialEq for ExpressionOnlyStore
Auto Trait Implementations§
impl Freeze for ExpressionOnlyStore
impl RefUnwindSafe for ExpressionOnlyStore
impl Send for ExpressionOnlyStore
impl Sync for ExpressionOnlyStore
impl Unpin for ExpressionOnlyStore
impl UnsafeUnpin for ExpressionOnlyStore
impl UnwindSafe for ExpressionOnlyStore
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more