pub struct MatchArm {
pub pattern: Pattern,
pub body: Box<Spanned<Expr>>,
pub binding_slots: OnceLock<Vec<u16>>,
}Fields§
§pattern: Pattern§body: Box<Spanned<Expr>>§binding_slots: OnceLock<Vec<u16>>Per-arm slot table for the pattern’s bindings, in pattern order.
Filled by the resolver pass; backend code reads from here
instead of doing a name lookup, so two arms with the same
binding name (e.g. deadline showing up in both TaskCreated
and DeadlineSet with different field types) get separate
slots without colliding in the function-level slot table.
Wildcard-position bindings (_) are stored as u16::MAX and
must never be read.
Implementations§
Source§impl MatchArm
impl MatchArm
Sourcepub fn new(pattern: Pattern, body: Spanned<Expr>) -> Self
pub fn new(pattern: Pattern, body: Spanned<Expr>) -> Self
Build a fresh arm with no binding-slot stamp yet — resolver
fills binding_slots after slot allocation. Use this from any
site that synthesises an arm (parser, AST rewrites, effect
lifting, tests).
pub fn new_boxed(pattern: Pattern, body: Box<Spanned<Expr>>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MatchArm
impl RefUnwindSafe for MatchArm
impl Send for MatchArm
impl Sync for MatchArm
impl Unpin for MatchArm
impl UnsafeUnpin for MatchArm
impl UnwindSafe for MatchArm
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