@@ -559,14 +559,16 @@ impl<'tcx> WfPredicates<'tcx> {
559
559
}
560
560
}
561
561
562
- ty:: Generator ( ..) => {
562
+ ty:: Generator ( did , substs , ..) => {
563
563
// Walk ALL the types in the generator: this will
564
564
// include the upvar types as well as the yield
565
565
// type. Note that this is mildly distinct from
566
566
// the closure case, where we have to be careful
567
567
// about the signature of the closure. We don't
568
568
// have the problem of implied bounds here since
569
569
// generators don't take arguments.
570
+ let obligations = self . nominal_obligations ( did, substs) ;
571
+ self . out . extend ( obligations) ;
570
572
}
571
573
572
574
ty:: Closure ( did, substs) => {
@@ -618,11 +620,9 @@ impl<'tcx> WfPredicates<'tcx> {
618
620
}
619
621
620
622
ty:: Opaque ( did, substs) => {
621
- // all of the requirements on type parameters
622
- // should've been checked by the instantiation
623
- // of whatever returned this exact `impl Trait`.
624
-
625
- // for named opaque `impl Trait` types we still need to check them
623
+ // All of the requirements on type parameters
624
+ // have already been checked for `impl Trait` in
625
+ // return position. We do need to check type-alias-impl-trait though.
626
626
if ty:: is_impl_trait_defn ( self . tcx , did) . is_none ( ) {
627
627
let obligations = self . nominal_obligations ( did, substs) ;
628
628
self . out . extend ( obligations) ;
@@ -684,6 +684,7 @@ impl<'tcx> WfPredicates<'tcx> {
684
684
}
685
685
}
686
686
687
+ #[ instrument( level = "debug" , skip( self ) ) ]
687
688
fn nominal_obligations (
688
689
& mut self ,
689
690
def_id : DefId ,
@@ -698,6 +699,7 @@ impl<'tcx> WfPredicates<'tcx> {
698
699
}
699
700
700
701
let predicates = predicates. instantiate ( self . tcx , substs) ;
702
+ trace ! ( "{:#?}" , predicates) ;
701
703
debug_assert_eq ! ( predicates. predicates. len( ) , origins. len( ) ) ;
702
704
703
705
iter:: zip ( iter:: zip ( predicates. predicates , predicates. spans ) , origins. into_iter ( ) . rev ( ) )
0 commit comments