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
Expand description
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).
Expand description
Annotated with mut x – could be either ref or not, similar to None.
Expand description
Annotated as ref, like ref x
Expand description
Annotated as ref mut x.
Trait Implementations
impl Clone for BindingAnnotation[src]
impl Clone for BindingAnnotation[src]fn clone(&self) -> BindingAnnotation[src]
fn clone(&self) -> BindingAnnotation[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for BindingAnnotation[src]
impl Debug for BindingAnnotation[src]impl<__E: Encoder> Encodable<__E> for BindingAnnotation[src]
impl<__E: Encoder> Encodable<__E> for BindingAnnotation[src]impl<__CTX> HashStable<__CTX> for BindingAnnotation where
__CTX: HashStableContext, [src]
impl<__CTX> HashStable<__CTX> for BindingAnnotation where
__CTX: HashStableContext, [src]fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)[src]
impl PartialEq<BindingAnnotation> for BindingAnnotation[src]
impl PartialEq<BindingAnnotation> for BindingAnnotation[src]impl Copy for BindingAnnotation[src]
impl StructuralPartialEq for BindingAnnotation[src]
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
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more