@@ -666,7 +666,7 @@ impl ItemCtxt<'tcx> {
666
666
Some ( assoc_name) => self . bound_defines_assoc_item ( b, assoc_name) ,
667
667
None => true ,
668
668
} )
669
- . flat_map ( |b| predicates_from_bound ( self , ty, b) ) ;
669
+ . flat_map ( |b| predicates_from_bound ( self , ty, b, ty :: List :: empty ( ) ) ) ;
670
670
671
671
let param_def_id = self . tcx . hir ( ) . local_def_id ( param_id) . to_def_id ( ) ;
672
672
let from_where_clauses = ast_generics
@@ -685,15 +685,17 @@ impl ItemCtxt<'tcx> {
685
685
} else {
686
686
None
687
687
} ;
688
+ let bvars = self . tcx . late_bound_vars ( bp. bounded_ty . hir_id ) ;
689
+
688
690
bp. bounds
689
691
. iter ( )
690
692
. filter ( |b| match assoc_name {
691
693
Some ( assoc_name) => self . bound_defines_assoc_item ( b, assoc_name) ,
692
694
None => true ,
693
695
} )
694
- . filter_map ( move |b| bt. map ( |bt| ( bt, b) ) )
696
+ . filter_map ( move |b| bt. map ( |bt| ( bt, b, bvars ) ) )
695
697
} )
696
- . flat_map ( |( bt, b) | predicates_from_bound ( self , bt, b) ) ;
698
+ . flat_map ( |( bt, b, bvars ) | predicates_from_bound ( self , bt, b, bvars ) ) ;
697
699
698
700
from_ty_params. chain ( from_where_clauses) . collect ( )
699
701
}
@@ -2433,14 +2435,10 @@ fn predicates_from_bound<'tcx>(
2433
2435
astconv : & dyn AstConv < ' tcx > ,
2434
2436
param_ty : Ty < ' tcx > ,
2435
2437
bound : & ' tcx hir:: GenericBound < ' tcx > ,
2438
+ bound_vars : & ' tcx ty:: List < ty:: BoundVariableKind > ,
2436
2439
) -> Vec < ( ty:: Predicate < ' tcx > , Span ) > {
2437
2440
let mut bounds = Bounds :: default ( ) ;
2438
- astconv. add_bounds (
2439
- param_ty,
2440
- std:: array:: IntoIter :: new ( [ bound] ) ,
2441
- & mut bounds,
2442
- ty:: List :: empty ( ) ,
2443
- ) ;
2441
+ astconv. add_bounds ( param_ty, std:: array:: IntoIter :: new ( [ bound] ) , & mut bounds, bound_vars) ;
2444
2442
bounds. predicates ( astconv. tcx ( ) , param_ty)
2445
2443
}
2446
2444
0 commit comments