@@ -10,7 +10,7 @@ use rustc_errors::Applicability;
1010use rustc_hir:: { Expr , Mutability } ;
1111use rustc_lint:: LateContext ;
1212use 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 } ;
1414use rustc_span:: sym;
1515
1616pub ( super ) fn check (
@@ -160,7 +160,7 @@ fn is_ref_iterable<'tcx>(
160160 let self_ty = if mutbl. is_mut ( ) {
161161 self_ty
162162 } else {
163- Ty :: new_ref ( cx. tcx , region, TypeAndMut { ty, mutbl } )
163+ Ty :: new_ref ( cx. tcx , region, ty, mutbl)
164164 } ;
165165 if implements_trait ( cx, self_ty, trait_id, & [ ] )
166166 && let Some ( ty) =
@@ -175,7 +175,7 @@ fn is_ref_iterable<'tcx>(
175175 && !self_ty. is_ref ( )
176176 {
177177 // 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) ;
179179 if implements_trait ( cx, self_ty, trait_id, & [ ] )
180180 && let Some ( ty) = make_normalized_projection ( cx. tcx , cx. param_env , trait_id, sym ! ( IntoIter ) , [ self_ty] )
181181 && ty == res_ty
0 commit comments