@@ -151,7 +151,7 @@ fn is_ref_iterable<'tcx>(
151
151
// Using by value won't consume anything
152
152
if implements_trait ( cx, self_ty, trait_id, & [ ] )
153
153
&& 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] )
155
155
&& ty == res_ty
156
156
{
157
157
return Some ( ( AdjustKind :: None , self_ty) ) ;
@@ -168,7 +168,7 @@ fn is_ref_iterable<'tcx>(
168
168
} ;
169
169
if implements_trait ( cx, self_ty, trait_id, & [ ] )
170
170
&& 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] )
172
172
&& ty == res_ty
173
173
{
174
174
return Some ( ( AdjustKind :: reborrow ( mutbl) , self_ty) ) ;
@@ -181,7 +181,7 @@ fn is_ref_iterable<'tcx>(
181
181
// Attempt to borrow
182
182
let self_ty = Ty :: new_ref ( cx. tcx , cx. tcx . lifetimes . re_erased , self_ty, mutbl) ;
183
183
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] )
185
185
&& ty == res_ty
186
186
{
187
187
return Some ( ( AdjustKind :: borrow ( mutbl) , self_ty) ) ;
@@ -204,7 +204,7 @@ fn is_ref_iterable<'tcx>(
204
204
&& target != self_ty
205
205
&& implements_trait ( cx, target, trait_id, & [ ] )
206
206
&& 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] )
208
208
&& ty == res_ty
209
209
{
210
210
Some ( ( AdjustKind :: auto_reborrow ( mutbl) , target) )
@@ -222,7 +222,7 @@ fn is_ref_iterable<'tcx>(
222
222
if is_copy ( cx, target)
223
223
&& implements_trait ( cx, target, trait_id, & [ ] )
224
224
&& 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] )
226
226
&& ty == res_ty
227
227
{
228
228
Some ( ( AdjustKind :: Deref , target) )
@@ -240,7 +240,7 @@ fn is_ref_iterable<'tcx>(
240
240
if self_ty. is_ref ( )
241
241
&& implements_trait ( cx, target, trait_id, & [ ] )
242
242
&& 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] )
244
244
&& ty == res_ty
245
245
{
246
246
Some ( ( AdjustKind :: auto_borrow ( mutbl) , target) )
0 commit comments