1 use rustc_hir
::BindingAnnotation
;
2 use rustc_hir
::BindingAnnotation
::*;
3 use rustc_hir
::Mutability
;
5 #[derive(Clone, PartialEq, TyEncodable, TyDecodable, Debug, Copy, HashStable)]
7 BindByReference(Mutability
),
8 BindByValue(Mutability
),
11 CloneTypeFoldableAndLiftImpls
! { BindingMode, }
14 pub fn convert(ba
: BindingAnnotation
) -> BindingMode
{
16 Unannotated
=> BindingMode
::BindByValue(Mutability
::Not
),
17 Mutable
=> BindingMode
::BindByValue(Mutability
::Mut
),
18 Ref
=> BindingMode
::BindByReference(Mutability
::Not
),
19 RefMut
=> BindingMode
::BindByReference(Mutability
::Mut
),