type PatternBindings = SmallVec<[(PatBoundCtx, FxIndexMap<Ident, Res<NodeId>>); 1]>;
Expand description
Tracks bindings resolved within a pattern. This serves two purposes:
-
This tracks when identifiers are bound multiple times within a pattern. In a product context, this is an error. In an or-pattern, this lets us reuse the same resolution for each instance. See
fresh_binding
andresolve_pattern_inner
for more information. -
The guard expression of a guard pattern may use bindings from within the guard pattern, but not from elsewhere in the pattern containing it. This allows us to isolate the bindings in the subpattern to construct the scope for the guard.
Each identifier must map to at most one distinct Res
.
Aliased Type§
struct PatternBindings { /* private fields */ }
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: 72 bytes