@@ -176,24 +176,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
176176 match * expected_ty. kind ( ) {
177177 ty:: Opaque ( def_id, substs) => {
178178 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+ {
183184 ty:: PredicateKind :: Projection ( proj_predicate) => self
184185 . 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) ,
189188 ) ,
190189 _ => None ,
191190 } ) ;
192191
193192 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 ( ) {
197196 ty:: PredicateKind :: Trait ( tp) => {
198197 self . tcx . fn_trait_kind_from_lang_item ( tp. def_id ( ) )
199198 }
@@ -697,18 +696,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
697696 ty:: Opaque ( def_id, substs) => self
698697 . tcx
699698 . 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) ) ?,
703701 ty:: Error ( _) => return None ,
704702 ty:: Projection ( proj)
705703 if self . tcx . def_kind ( proj. item_def_id ) == DefKind :: ImplTraitPlaceholder =>
706704 {
707705 self . tcx
708706 . 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) ) ?
712709 }
713710 _ => span_bug ! (
714711 self . tcx. def_span( expr_def_id) ,
0 commit comments