pub enum ProtoRef {
Kind(TyKind),
Ref(Expr),
}Expand description
The prototype an as <Proto> pattern narrows to. One rule covers both forms —
the subject matches iff its prototype is the named module — and they differ
only in how much of the work is left to run time.
Variants§
Kind(TyKind)
The compiled fast form: a reference the resolver recognized as the
builtin module that is some value kind’s prototype, so the check is the
discriminant test TyKind always was rather than an eval plus a pointer
compare. as Int takes this path, alias or __-spelling alike.
Ref(Expr)
Any other prototype, named by an atom — a module item, a local, a
frame slot, or __module. Resolved like an Equal
comparand, evaluated at match time, and required to be a module value.
Trait Implementations§
impl Eq for ProtoRef
impl StructuralPartialEq for ProtoRef
Auto Trait Implementations§
impl Freeze for ProtoRef
impl !RefUnwindSafe for ProtoRef
impl !Send for ProtoRef
impl !Sync for ProtoRef
impl Unpin for ProtoRef
impl UnsafeUnpin for ProtoRef
impl !UnwindSafe for ProtoRef
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