@@ -10,7 +10,7 @@ use rustc_errors::Applicability;
10
10
use rustc_hir:: { Expr , Mutability } ;
11
11
use rustc_lint:: LateContext ;
12
12
use rustc_middle:: ty:: adjustment:: { Adjust , Adjustment , AutoBorrow , AutoBorrowMutability } ;
13
- use rustc_middle:: ty:: { self , EarlyBinder , Ty , TypeAndMut } ;
13
+ use rustc_middle:: ty:: { self , EarlyBinder , Ty } ;
14
14
use rustc_span:: sym;
15
15
16
16
pub ( super ) fn check (
@@ -160,7 +160,7 @@ fn is_ref_iterable<'tcx>(
160
160
let self_ty = if mutbl. is_mut ( ) {
161
161
self_ty
162
162
} else {
163
- Ty :: new_ref ( cx. tcx , region, TypeAndMut { ty, mutbl } )
163
+ Ty :: new_ref ( cx. tcx , region, ty, mutbl)
164
164
} ;
165
165
if implements_trait ( cx, self_ty, trait_id, & [ ] )
166
166
&& let Some ( ty) =
@@ -175,7 +175,7 @@ fn is_ref_iterable<'tcx>(
175
175
&& !self_ty. is_ref ( )
176
176
{
177
177
// Attempt to borrow
178
- let self_ty = Ty :: new_ref ( cx. tcx , cx. tcx . lifetimes . re_erased , TypeAndMut { ty : self_ty, mutbl } ) ;
178
+ let self_ty = Ty :: new_ref ( cx. tcx , cx. tcx . lifetimes . re_erased , self_ty, mutbl) ;
179
179
if implements_trait ( cx, self_ty, trait_id, & [ ] )
180
180
&& let Some ( ty) = make_normalized_projection ( cx. tcx , cx. param_env , trait_id, sym ! ( IntoIter ) , [ self_ty] )
181
181
&& ty == res_ty
0 commit comments