@@ -1817,7 +1817,7 @@ fn confirm_generator_candidate<'cx, 'tcx>(
1817
1817
obligation : & ProjectionTyObligation < ' tcx > ,
1818
1818
impl_source : ImplSourceGeneratorData < ' tcx , PredicateObligation < ' tcx > > ,
1819
1819
) -> Progress < ' tcx > {
1820
- let gen_sig = impl_source. substs . as_generator ( ) . poly_sig ( ) ;
1820
+ let gen_sig = impl_source. substs . as_generator ( ) . sig ( ) ;
1821
1821
let Normalized { value : gen_sig, obligations } = normalize_with_depth (
1822
1822
selcx,
1823
1823
obligation. param_env ,
@@ -1832,26 +1832,24 @@ fn confirm_generator_candidate<'cx, 'tcx>(
1832
1832
1833
1833
let gen_def_id = tcx. require_lang_item ( LangItem :: Generator , None ) ;
1834
1834
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 (
1836
1836
tcx,
1837
1837
gen_def_id,
1838
1838
obligation. predicate . self_ty ( ) ,
1839
1839
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
+ ) ;
1850
1841
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 ( ) ,
1855
1853
} ) ;
1856
1854
1857
1855
confirm_param_env_candidate ( selcx, obligation, predicate, false )
@@ -1864,7 +1862,7 @@ fn confirm_future_candidate<'cx, 'tcx>(
1864
1862
obligation : & ProjectionTyObligation < ' tcx > ,
1865
1863
impl_source : ImplSourceFutureData < ' tcx , PredicateObligation < ' tcx > > ,
1866
1864
) -> Progress < ' tcx > {
1867
- let gen_sig = impl_source. substs . as_generator ( ) . poly_sig ( ) ;
1865
+ let gen_sig = impl_source. substs . as_generator ( ) . sig ( ) ;
1868
1866
let Normalized { value : gen_sig, obligations } = normalize_with_depth (
1869
1867
selcx,
1870
1868
obligation. param_env ,
@@ -1878,19 +1876,17 @@ fn confirm_future_candidate<'cx, 'tcx>(
1878
1876
let tcx = selcx. tcx ( ) ;
1879
1877
let fut_def_id = tcx. require_lang_item ( LangItem :: Future , None ) ;
1880
1878
1881
- let predicate = super :: util:: future_trait_ref_and_outputs (
1879
+ let ( trait_ref , return_ty ) = super :: util:: future_trait_ref_and_outputs (
1882
1880
tcx,
1883
1881
fut_def_id,
1884
1882
obligation. predicate . self_ty ( ) ,
1885
1883
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
+ ) ;
1889
1885
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 ( ) ,
1894
1890
} ) ;
1895
1891
1896
1892
confirm_param_env_candidate ( selcx, obligation, predicate, false )
0 commit comments