@@ -151,7 +151,7 @@ fn is_ref_iterable<'tcx>(
151151 // Using by value won't consume anything
152152 if implements_trait ( cx, self_ty, trait_id, & [ ] )
153153 && let Some ( ty) =
154- make_normalized_projection ( cx. tcx , cx. param_env , trait_id, sym ! ( IntoIter ) , [ self_ty] )
154+ make_normalized_projection ( cx. tcx , cx. typing_env ( ) , trait_id, sym ! ( IntoIter ) , [ self_ty] )
155155 && ty == res_ty
156156 {
157157 return Some ( ( AdjustKind :: None , self_ty) ) ;
@@ -168,7 +168,7 @@ fn is_ref_iterable<'tcx>(
168168 } ;
169169 if implements_trait ( cx, self_ty, trait_id, & [ ] )
170170 && let Some ( ty) =
171- make_normalized_projection ( cx. tcx , cx. param_env , trait_id, sym ! ( IntoIter ) , [ self_ty] )
171+ make_normalized_projection ( cx. tcx , cx. typing_env ( ) , trait_id, sym ! ( IntoIter ) , [ self_ty] )
172172 && ty == res_ty
173173 {
174174 return Some ( ( AdjustKind :: reborrow ( mutbl) , self_ty) ) ;
@@ -181,7 +181,7 @@ fn is_ref_iterable<'tcx>(
181181 // Attempt to borrow
182182 let self_ty = Ty :: new_ref ( cx. tcx , cx. tcx . lifetimes . re_erased , self_ty, mutbl) ;
183183 if implements_trait ( cx, self_ty, trait_id, & [ ] )
184- && let Some ( ty) = make_normalized_projection ( cx. tcx , cx. param_env , trait_id, sym ! ( IntoIter ) , [ self_ty] )
184+ && let Some ( ty) = make_normalized_projection ( cx. tcx , cx. typing_env ( ) , trait_id, sym ! ( IntoIter ) , [ self_ty] )
185185 && ty == res_ty
186186 {
187187 return Some ( ( AdjustKind :: borrow ( mutbl) , self_ty) ) ;
@@ -204,7 +204,7 @@ fn is_ref_iterable<'tcx>(
204204 && target != self_ty
205205 && implements_trait ( cx, target, trait_id, & [ ] )
206206 && let Some ( ty) =
207- make_normalized_projection ( cx. tcx , cx. param_env , trait_id, sym ! ( IntoIter ) , [ target] )
207+ make_normalized_projection ( cx. tcx , cx. typing_env ( ) , trait_id, sym ! ( IntoIter ) , [ target] )
208208 && ty == res_ty
209209 {
210210 Some ( ( AdjustKind :: auto_reborrow ( mutbl) , target) )
@@ -222,7 +222,7 @@ fn is_ref_iterable<'tcx>(
222222 if is_copy ( cx, target)
223223 && implements_trait ( cx, target, trait_id, & [ ] )
224224 && let Some ( ty) =
225- make_normalized_projection ( cx. tcx , cx. param_env , trait_id, sym ! ( IntoIter ) , [ target] )
225+ make_normalized_projection ( cx. tcx , cx. typing_env ( ) , trait_id, sym ! ( IntoIter ) , [ target] )
226226 && ty == res_ty
227227 {
228228 Some ( ( AdjustKind :: Deref , target) )
@@ -240,7 +240,7 @@ fn is_ref_iterable<'tcx>(
240240 if self_ty. is_ref ( )
241241 && implements_trait ( cx, target, trait_id, & [ ] )
242242 && let Some ( ty) =
243- make_normalized_projection ( cx. tcx , cx. param_env , trait_id, sym ! ( IntoIter ) , [ target] )
243+ make_normalized_projection ( cx. tcx , cx. typing_env ( ) , trait_id, sym ! ( IntoIter ) , [ target] )
244244 && ty == res_ty
245245 {
246246 Some ( ( AdjustKind :: auto_borrow ( mutbl) , target) )
0 commit comments