@@ -1507,8 +1507,8 @@ fn make_iterator_snippet(cx: &LateContext<'_, '_>, arg: &Expr, applic_ref: &mut
1507
1507
if has_iter_method ( cx, cx. tables . expr_ty ( & arg_inner) ) . is_some ( ) =>
1508
1508
{
1509
1509
let meth_name = match mutability {
1510
- Mutability :: Mutable => "iter_mut" ,
1511
- Mutability :: Immutable => "iter" ,
1510
+ Mutability :: Mut => "iter_mut" ,
1511
+ Mutability :: Not => "iter" ,
1512
1512
} ;
1513
1513
format ! (
1514
1514
"{}.{}()" ,
@@ -1540,14 +1540,14 @@ fn check_for_loop_over_map_kv<'a, 'tcx>(
1540
1540
let ( new_pat_span, kind, ty, mutbl) = match cx. tables . expr_ty ( arg) . kind {
1541
1541
ty:: Ref ( _, ty, mutbl) => match ( & pat[ 0 ] . kind , & pat[ 1 ] . kind ) {
1542
1542
( 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 ) ,
1544
1544
_ => return ,
1545
1545
} ,
1546
1546
_ => return ,
1547
1547
} ;
1548
1548
let mutbl = match mutbl {
1549
- Mutability :: Immutable => "" ,
1550
- Mutability :: Mutable => "_mut" ,
1549
+ Mutability :: Not => "" ,
1550
+ Mutability :: Mut => "_mut" ,
1551
1551
} ;
1552
1552
let arg = match arg. kind {
1553
1553
ExprKind :: AddrOf ( BorrowKind :: Ref , _, ref expr) => & * * expr,
@@ -1868,7 +1868,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
1868
1868
self . visit_expr ( rhs) ;
1869
1869
} ,
1870
1870
ExprKind :: AddrOf ( BorrowKind :: Ref , mutbl, ref expr) => {
1871
- if mutbl == Mutability :: Mutable {
1871
+ if mutbl == Mutability :: Mut {
1872
1872
self . prefer_mutable = true ;
1873
1873
}
1874
1874
self . visit_expr ( expr) ;
@@ -1879,7 +1879,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
1879
1879
let ty = self . cx . tables . expr_ty_adjusted ( expr) ;
1880
1880
self . prefer_mutable = false ;
1881
1881
if let ty:: Ref ( _, _, mutbl) = ty. kind {
1882
- if mutbl == Mutability :: Mutable {
1882
+ if mutbl == Mutability :: Mut {
1883
1883
self . prefer_mutable = true ;
1884
1884
}
1885
1885
}
@@ -1891,7 +1891,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
1891
1891
for ( ty, expr) in self . cx . tcx . fn_sig ( def_id) . inputs ( ) . skip_binder ( ) . iter ( ) . zip ( args) {
1892
1892
self . prefer_mutable = false ;
1893
1893
if let ty:: Ref ( _, _, mutbl) = ty. kind {
1894
- if mutbl == Mutability :: Mutable {
1894
+ if mutbl == Mutability :: Mut {
1895
1895
self . prefer_mutable = true ;
1896
1896
}
1897
1897
}
@@ -2084,7 +2084,7 @@ impl<'a, 'tcx> Visitor<'tcx> for IncrementVisitor<'a, 'tcx> {
2084
2084
}
2085
2085
} ,
2086
2086
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 => {
2088
2088
* state = VarState :: DontWarn
2089
2089
} ,
2090
2090
_ => ( ) ,
@@ -2168,7 +2168,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
2168
2168
VarState :: DontWarn
2169
2169
}
2170
2170
} ,
2171
- ExprKind :: AddrOf ( BorrowKind :: Ref , mutability, _) if mutability == Mutability :: Mutable => {
2171
+ ExprKind :: AddrOf ( BorrowKind :: Ref , mutability, _) if mutability == Mutability :: Mut => {
2172
2172
self . state = VarState :: DontWarn
2173
2173
} ,
2174
2174
_ => ( ) ,
0 commit comments