@@ -176,24 +176,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
176
176
match * expected_ty. kind ( ) {
177
177
ty:: Opaque ( def_id, substs) => {
178
178
let bounds = self . tcx . bound_explicit_item_bounds ( def_id) ;
179
- let sig = bounds
180
- . transpose_iter ( )
181
- . map ( |e| e. map_bound ( |e| * e) . transpose_tuple2 ( ) )
182
- . find_map ( |( pred, span) | match pred. 0 . kind ( ) . skip_binder ( ) {
179
+ let sig =
180
+ bounds. subst_iter_copied ( self . tcx , substs) . find_map ( |( pred, span) | match pred
181
+ . kind ( )
182
+ . skip_binder ( )
183
+ {
183
184
ty:: PredicateKind :: Projection ( proj_predicate) => self
184
185
. deduce_sig_from_projection (
185
- Some ( span. 0 ) ,
186
- pred. 0
187
- . kind ( )
188
- . rebind ( pred. rebind ( proj_predicate) . subst ( self . tcx , substs) ) ,
186
+ Some ( span) ,
187
+ pred. kind ( ) . rebind ( proj_predicate) ,
189
188
) ,
190
189
_ => None ,
191
190
} ) ;
192
191
193
192
let kind = bounds
194
- . transpose_iter ( )
195
- . map ( |e| e . map_bound ( |e| * e ) . transpose_tuple2 ( ) )
196
- . filter_map ( |( pred, _) | match pred. 0 . kind ( ) . skip_binder ( ) {
193
+ . 0
194
+ . iter ( )
195
+ . filter_map ( |( pred, _) | match pred. kind ( ) . skip_binder ( ) {
197
196
ty:: PredicateKind :: Trait ( tp) => {
198
197
self . tcx . fn_trait_kind_from_lang_item ( tp. def_id ( ) )
199
198
}
@@ -697,18 +696,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
697
696
ty:: Opaque ( def_id, substs) => self
698
697
. tcx
699
698
. bound_explicit_item_bounds ( def_id)
700
- . transpose_iter ( )
701
- . map ( |e| e. map_bound ( |e| * e) . transpose_tuple2 ( ) )
702
- . find_map ( |( p, s) | get_future_output ( p. subst ( self . tcx , substs) , s. 0 ) ) ?,
699
+ . subst_iter_copied ( self . tcx , substs)
700
+ . find_map ( |( p, s) | get_future_output ( p, s) ) ?,
703
701
ty:: Error ( _) => return None ,
704
702
ty:: Projection ( proj)
705
703
if self . tcx . def_kind ( proj. item_def_id ) == DefKind :: ImplTraitPlaceholder =>
706
704
{
707
705
self . tcx
708
706
. bound_explicit_item_bounds ( proj. item_def_id )
709
- . transpose_iter ( )
710
- . map ( |e| e. map_bound ( |e| * e) . transpose_tuple2 ( ) )
711
- . find_map ( |( p, s) | get_future_output ( p. subst ( self . tcx , proj. substs ) , s. 0 ) ) ?
707
+ . subst_iter_copied ( self . tcx , proj. substs )
708
+ . find_map ( |( p, s) | get_future_output ( p, s) ) ?
712
709
}
713
710
_ => span_bug ! (
714
711
self . tcx. def_span( expr_def_id) ,
0 commit comments