Enum rustc_hir::hir::BindingAnnotation [−][src]
pub enum BindingAnnotation {
Unannotated,
Mutable,
Ref,
RefMut,
}
Expand description
Explicit binding annotations given in the HIR for a binding. Note that this is not the final binding mode that we infer after type inference.
Variants
No binding annotation given: this means that the final binding mode
will depend on whether we have skipped through a &
reference
when matching. For example, the x
in Some(x)
will have binding
mode None
; if you do let Some(x) = &Some(22)
, it will
ultimately be inferred to be by-reference.
Note that implicit reference skipping is not implemented yet (#42640).
Annotated with mut x
– could be either ref or not, similar to None
.
Annotated as ref
, like ref x
Annotated as ref mut x
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BindingAnnotation
impl Send for BindingAnnotation
impl Sync for BindingAnnotation
impl Unpin for BindingAnnotation
impl UnwindSafe for BindingAnnotation
Blanket Implementations
Mutably borrows from an owned value. Read more
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: 1 byte
Size for each variant:
Unannotated
: 0 bytesMutable
: 0 bytesRef
: 0 bytesRefMut
: 0 bytes