@@ -1507,8 +1507,8 @@ fn make_iterator_snippet(cx: &LateContext<'_, '_>, arg: &Expr, applic_ref: &mut
15071507 if has_iter_method ( cx, cx. tables . expr_ty ( & arg_inner) ) . is_some ( ) =>
15081508 {
15091509 let meth_name = match mutability {
1510- Mutability :: Mutable => "iter_mut" ,
1511- Mutability :: Immutable => "iter" ,
1510+ Mutability :: Mut => "iter_mut" ,
1511+ Mutability :: Not => "iter" ,
15121512 } ;
15131513 format ! (
15141514 "{}.{}()" ,
@@ -1540,14 +1540,14 @@ fn check_for_loop_over_map_kv<'a, 'tcx>(
15401540 let ( new_pat_span, kind, ty, mutbl) = match cx. tables . expr_ty ( arg) . kind {
15411541 ty:: Ref ( _, ty, mutbl) => match ( & pat[ 0 ] . kind , & pat[ 1 ] . kind ) {
15421542 ( key, _) if pat_is_wild ( key, body) => ( pat[ 1 ] . span , "value" , ty, mutbl) ,
1543- ( _, value) if pat_is_wild ( value, body) => ( pat[ 0 ] . span , "key" , ty, Mutability :: Immutable ) ,
1543+ ( _, value) if pat_is_wild ( value, body) => ( pat[ 0 ] . span , "key" , ty, Mutability :: Not ) ,
15441544 _ => return ,
15451545 } ,
15461546 _ => return ,
15471547 } ;
15481548 let mutbl = match mutbl {
1549- Mutability :: Immutable => "" ,
1550- Mutability :: Mutable => "_mut" ,
1549+ Mutability :: Not => "" ,
1550+ Mutability :: Mut => "_mut" ,
15511551 } ;
15521552 let arg = match arg. kind {
15531553 ExprKind :: AddrOf ( BorrowKind :: Ref , _, ref expr) => & * * expr,
@@ -1868,7 +1868,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
18681868 self . visit_expr ( rhs) ;
18691869 } ,
18701870 ExprKind :: AddrOf ( BorrowKind :: Ref , mutbl, ref expr) => {
1871- if mutbl == Mutability :: Mutable {
1871+ if mutbl == Mutability :: Mut {
18721872 self . prefer_mutable = true ;
18731873 }
18741874 self . visit_expr ( expr) ;
@@ -1879,7 +1879,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
18791879 let ty = self . cx . tables . expr_ty_adjusted ( expr) ;
18801880 self . prefer_mutable = false ;
18811881 if let ty:: Ref ( _, _, mutbl) = ty. kind {
1882- if mutbl == Mutability :: Mutable {
1882+ if mutbl == Mutability :: Mut {
18831883 self . prefer_mutable = true ;
18841884 }
18851885 }
@@ -1891,7 +1891,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
18911891 for ( ty, expr) in self . cx . tcx . fn_sig ( def_id) . inputs ( ) . skip_binder ( ) . iter ( ) . zip ( args) {
18921892 self . prefer_mutable = false ;
18931893 if let ty:: Ref ( _, _, mutbl) = ty. kind {
1894- if mutbl == Mutability :: Mutable {
1894+ if mutbl == Mutability :: Mut {
18951895 self . prefer_mutable = true ;
18961896 }
18971897 }
@@ -2084,7 +2084,7 @@ impl<'a, 'tcx> Visitor<'tcx> for IncrementVisitor<'a, 'tcx> {
20842084 }
20852085 } ,
20862086 ExprKind :: Assign ( ref lhs, _) if lhs. hir_id == expr. hir_id => * state = VarState :: DontWarn ,
2087- ExprKind :: AddrOf ( BorrowKind :: Ref , mutability, _) if mutability == Mutability :: Mutable => {
2087+ ExprKind :: AddrOf ( BorrowKind :: Ref , mutability, _) if mutability == Mutability :: Mut => {
20882088 * state = VarState :: DontWarn
20892089 } ,
20902090 _ => ( ) ,
@@ -2168,7 +2168,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
21682168 VarState :: DontWarn
21692169 }
21702170 } ,
2171- ExprKind :: AddrOf ( BorrowKind :: Ref , mutability, _) if mutability == Mutability :: Mutable => {
2171+ ExprKind :: AddrOf ( BorrowKind :: Ref , mutability, _) if mutability == Mutability :: Mut => {
21722172 self . state = VarState :: DontWarn
21732173 } ,
21742174 _ => ( ) ,
0 commit comments