@@ -1817,7 +1817,7 @@ fn confirm_generator_candidate<'cx, 'tcx>(
18171817 obligation : & ProjectionTyObligation < ' tcx > ,
18181818 impl_source : ImplSourceGeneratorData < ' tcx , PredicateObligation < ' tcx > > ,
18191819) -> Progress < ' tcx > {
1820- let gen_sig = impl_source. substs . as_generator ( ) . poly_sig ( ) ;
1820+ let gen_sig = impl_source. substs . as_generator ( ) . sig ( ) ;
18211821 let Normalized { value : gen_sig, obligations } = normalize_with_depth (
18221822 selcx,
18231823 obligation. param_env ,
@@ -1832,26 +1832,24 @@ fn confirm_generator_candidate<'cx, 'tcx>(
18321832
18331833 let gen_def_id = tcx. require_lang_item ( LangItem :: Generator , None ) ;
18341834
1835- let predicate = super :: util:: generator_trait_ref_and_outputs (
1835+ let ( trait_ref , yield_ty , return_ty ) = super :: util:: generator_trait_ref_and_outputs (
18361836 tcx,
18371837 gen_def_id,
18381838 obligation. predicate . self_ty ( ) ,
18391839 gen_sig,
1840- )
1841- . map_bound ( |( trait_ref, yield_ty, return_ty) | {
1842- let name = tcx. associated_item ( obligation. predicate . def_id ) . name ;
1843- let ty = if name == sym:: Return {
1844- return_ty
1845- } else if name == sym:: Yield {
1846- yield_ty
1847- } else {
1848- bug ! ( )
1849- } ;
1840+ ) ;
18501841
1851- ty:: ProjectionPredicate {
1852- projection_ty : tcx. mk_alias_ty ( obligation. predicate . def_id , trait_ref. substs ) ,
1853- term : ty. into ( ) ,
1854- }
1842+ let name = tcx. associated_item ( obligation. predicate . def_id ) . name ;
1843+ let ty = if name == sym:: Return {
1844+ return_ty
1845+ } else if name == sym:: Yield {
1846+ yield_ty
1847+ } else {
1848+ bug ! ( )
1849+ } ;
1850+ let predicate = ty:: Binder :: dummy ( ty:: ProjectionPredicate {
1851+ projection_ty : tcx. mk_alias_ty ( obligation. predicate . def_id , trait_ref. substs ) ,
1852+ term : ty. into ( ) ,
18551853 } ) ;
18561854
18571855 confirm_param_env_candidate ( selcx, obligation, predicate, false )
@@ -1864,7 +1862,7 @@ fn confirm_future_candidate<'cx, 'tcx>(
18641862 obligation : & ProjectionTyObligation < ' tcx > ,
18651863 impl_source : ImplSourceFutureData < ' tcx , PredicateObligation < ' tcx > > ,
18661864) -> Progress < ' tcx > {
1867- let gen_sig = impl_source. substs . as_generator ( ) . poly_sig ( ) ;
1865+ let gen_sig = impl_source. substs . as_generator ( ) . sig ( ) ;
18681866 let Normalized { value : gen_sig, obligations } = normalize_with_depth (
18691867 selcx,
18701868 obligation. param_env ,
@@ -1878,19 +1876,17 @@ fn confirm_future_candidate<'cx, 'tcx>(
18781876 let tcx = selcx. tcx ( ) ;
18791877 let fut_def_id = tcx. require_lang_item ( LangItem :: Future , None ) ;
18801878
1881- let predicate = super :: util:: future_trait_ref_and_outputs (
1879+ let ( trait_ref , return_ty ) = super :: util:: future_trait_ref_and_outputs (
18821880 tcx,
18831881 fut_def_id,
18841882 obligation. predicate . self_ty ( ) ,
18851883 gen_sig,
1886- )
1887- . map_bound ( |( trait_ref, return_ty) | {
1888- debug_assert_eq ! ( tcx. associated_item( obligation. predicate. def_id) . name, sym:: Output ) ;
1884+ ) ;
18891885
1890- ty :: ProjectionPredicate {
1891- projection_ty : tcx . mk_alias_ty ( obligation . predicate . def_id , trait_ref . substs ) ,
1892- term : return_ty . into ( ) ,
1893- }
1886+ debug_assert_eq ! ( tcx . associated_item ( obligation . predicate . def_id ) . name , sym :: Output ) ;
1887+ let predicate = ty :: Binder :: dummy ( ty :: ProjectionPredicate {
1888+ projection_ty : tcx . mk_alias_ty ( obligation . predicate . def_id , trait_ref . substs ) ,
1889+ term : return_ty . into ( ) ,
18941890 } ) ;
18951891
18961892 confirm_param_env_candidate ( selcx, obligation, predicate, false )
0 commit comments