@@ -583,27 +583,27 @@ impl ItemCtxt<'tcx> {
583
583
param_id : hir:: HirId ,
584
584
ty : Ty < ' tcx > ,
585
585
only_self_bounds : OnlySelfBounds ,
586
- ) -> Vec < ( ty:: Predicate < ' tcx > , Span ) > {
586
+ ) -> impl Iterator < Item = ( ty:: Predicate < ' tcx > , Span ) > + ' _ {
587
587
let constness = self . default_constness_for_trait_bounds ( ) ;
588
588
let from_ty_params = ast_generics
589
589
. params
590
590
. iter ( )
591
- . filter_map ( |param| match param. kind {
591
+ . filter_map ( move |param| match param. kind {
592
592
GenericParamKind :: Type { .. } if param. hir_id == param_id => Some ( & param. bounds ) ,
593
593
_ => None ,
594
594
} )
595
- . flat_map ( |bounds| bounds. iter ( ) )
596
- . flat_map ( |b| predicates_from_bound ( self , ty, b, constness) ) ;
595
+ . flat_map ( move |bounds| bounds. iter ( ) )
596
+ . flat_map ( move |b| predicates_from_bound ( self , ty, b, constness) ) ;
597
597
598
598
let from_where_clauses = ast_generics
599
599
. where_clause
600
600
. predicates
601
601
. iter ( )
602
- . filter_map ( |wp| match * wp {
602
+ . filter_map ( move |wp| match * wp {
603
603
hir:: WherePredicate :: BoundPredicate ( ref bp) => Some ( bp) ,
604
604
_ => None ,
605
605
} )
606
- . flat_map ( |bp| {
606
+ . flat_map ( move |bp| {
607
607
let bt = if is_param ( self . tcx , & bp. bounded_ty , param_id) {
608
608
Some ( ty)
609
609
} else if !only_self_bounds. 0 {
@@ -613,9 +613,9 @@ impl ItemCtxt<'tcx> {
613
613
} ;
614
614
bp. bounds . iter ( ) . filter_map ( move |b| bt. map ( |bt| ( bt, b) ) )
615
615
} )
616
- . flat_map ( |( bt, b) | predicates_from_bound ( self , bt, b, constness) ) ;
616
+ . flat_map ( move |( bt, b) | predicates_from_bound ( self , bt, b, constness) ) ;
617
617
618
- from_ty_params. chain ( from_where_clauses) . collect ( )
618
+ from_ty_params. chain ( from_where_clauses)
619
619
}
620
620
}
621
621
0 commit comments