@@ -559,14 +559,16 @@ impl<'tcx> WfPredicates<'tcx> {
559559 }
560560 }
561561
562- ty:: Generator ( ..) => {
562+ ty:: Generator ( did , substs , ..) => {
563563 // Walk ALL the types in the generator: this will
564564 // include the upvar types as well as the yield
565565 // type. Note that this is mildly distinct from
566566 // the closure case, where we have to be careful
567567 // about the signature of the closure. We don't
568568 // have the problem of implied bounds here since
569569 // generators don't take arguments.
570+ let obligations = self . nominal_obligations ( did, substs) ;
571+ self . out . extend ( obligations) ;
570572 }
571573
572574 ty:: Closure ( did, substs) => {
@@ -618,11 +620,9 @@ impl<'tcx> WfPredicates<'tcx> {
618620 }
619621
620622 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.
626626 if ty:: is_impl_trait_defn ( self . tcx , did) . is_none ( ) {
627627 let obligations = self . nominal_obligations ( did, substs) ;
628628 self . out . extend ( obligations) ;
@@ -684,6 +684,7 @@ impl<'tcx> WfPredicates<'tcx> {
684684 }
685685 }
686686
687+ #[ instrument( level = "debug" , skip( self ) ) ]
687688 fn nominal_obligations (
688689 & mut self ,
689690 def_id : DefId ,
@@ -698,6 +699,7 @@ impl<'tcx> WfPredicates<'tcx> {
698699 }
699700
700701 let predicates = predicates. instantiate ( self . tcx , substs) ;
702+ trace ! ( "{:#?}" , predicates) ;
701703 debug_assert_eq ! ( predicates. predicates. len( ) , origins. len( ) ) ;
702704
703705 iter:: zip ( iter:: zip ( predicates. predicates , predicates. spans ) , origins. into_iter ( ) . rev ( ) )
0 commit comments