@@ -181,9 +181,12 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
181
181
// on a trait we must also consider the bounds that follow the trait's name,
182
182
// like `trait Foo: A + B + C`.
183
183
if let Some ( self_bounds) = is_trait {
184
- let bounds = icx. lowerer ( ) . lower_mono_bounds (
184
+ let mut bounds = Bounds :: default ( ) ;
185
+ icx. lowerer ( ) . lower_bounds (
185
186
tcx. types . self_param ,
186
187
self_bounds,
188
+ & mut bounds,
189
+ ty:: List :: empty ( ) ,
187
190
PredicateFilter :: All ,
188
191
) ;
189
192
predicates. extend ( bounds. clauses ( tcx) ) ;
@@ -265,9 +268,9 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
265
268
}
266
269
267
270
let mut bounds = Bounds :: default ( ) ;
268
- icx. lowerer ( ) . lower_poly_bounds (
271
+ icx. lowerer ( ) . lower_bounds (
269
272
ty,
270
- bound_pred. bounds . iter ( ) ,
273
+ bound_pred. bounds ,
271
274
& mut bounds,
272
275
bound_vars,
273
276
PredicateFilter :: All ,
@@ -626,7 +629,7 @@ pub(super) fn implied_predicates_with_filter<'tcx>(
626
629
bug ! ( "trait_def_id {trait_def_id:?} is not an item" ) ;
627
630
} ;
628
631
629
- let ( generics, bounds ) = match item. kind {
632
+ let ( generics, superbounds ) = match item. kind {
630
633
hir:: ItemKind :: Trait ( .., generics, supertraits, _) => ( generics, supertraits) ,
631
634
hir:: ItemKind :: TraitAlias ( generics, supertraits) => ( generics, supertraits) ,
632
635
_ => span_bug ! ( item. span, "super_predicates invoked on non-trait" ) ,
@@ -635,7 +638,8 @@ pub(super) fn implied_predicates_with_filter<'tcx>(
635
638
let icx = ItemCtxt :: new ( tcx, trait_def_id) ;
636
639
637
640
let self_param_ty = tcx. types . self_param ;
638
- let superbounds = icx. lowerer ( ) . lower_mono_bounds ( self_param_ty, bounds, filter) ;
641
+ let mut bounds = Bounds :: default ( ) ;
642
+ icx. lowerer ( ) . lower_bounds ( self_param_ty, superbounds, & mut bounds, ty:: List :: empty ( ) , filter) ;
639
643
640
644
let where_bounds_that_match = icx. probe_ty_param_bounds_in_generics (
641
645
generics,
@@ -646,7 +650,7 @@ pub(super) fn implied_predicates_with_filter<'tcx>(
646
650
647
651
// Combine the two lists to form the complete set of superbounds:
648
652
let implied_bounds =
649
- & * tcx. arena . alloc_from_iter ( superbounds . clauses ( tcx) . chain ( where_bounds_that_match) ) ;
653
+ & * tcx. arena . alloc_from_iter ( bounds . clauses ( tcx) . chain ( where_bounds_that_match) ) ;
650
654
debug ! ( ?implied_bounds) ;
651
655
652
656
// Now require that immediate supertraits are lowered, which will, in
@@ -834,9 +838,9 @@ impl<'tcx> ItemCtxt<'tcx> {
834
838
} ;
835
839
836
840
let bound_vars = self . tcx . late_bound_vars ( predicate. hir_id ) ;
837
- self . lowerer ( ) . lower_poly_bounds (
841
+ self . lowerer ( ) . lower_bounds (
838
842
bound_ty,
839
- predicate. bounds . iter ( ) ,
843
+ predicate. bounds ,
840
844
& mut bounds,
841
845
bound_vars,
842
846
filter,
0 commit comments