@@ -2076,7 +2076,7 @@ fn confirm_coroutine_candidate<'cx, 'tcx>(
20762076 else {
20772077 unreachable ! ( )
20782078 } ;
2079- let coroutine_sig = args. as_coroutine ( ) . poly_sig ( ) ;
2079+ let coroutine_sig = args. as_coroutine ( ) . sig ( ) ;
20802080 let Normalized { value : coroutine_sig, obligations } = normalize_with_depth (
20812081 selcx,
20822082 obligation. param_env ,
@@ -2091,29 +2091,28 @@ fn confirm_coroutine_candidate<'cx, 'tcx>(
20912091
20922092 let coroutine_def_id = tcx. require_lang_item ( LangItem :: Coroutine , None ) ;
20932093
2094- let predicate = super :: util:: coroutine_trait_ref_and_outputs (
2094+ let ( trait_ref , yield_ty , return_ty ) = super :: util:: coroutine_trait_ref_and_outputs (
20952095 tcx,
20962096 coroutine_def_id,
20972097 obligation. predicate . self_ty ( ) ,
20982098 coroutine_sig,
2099- )
2100- . map_bound ( |( trait_ref, yield_ty, return_ty) | {
2101- let name = tcx. associated_item ( obligation. predicate . def_id ) . name ;
2102- let ty = if name == sym:: Return {
2103- return_ty
2104- } else if name == sym:: Yield {
2105- yield_ty
2106- } else {
2107- bug ! ( )
2108- } ;
2099+ ) ;
21092100
2110- ty:: ProjectionPredicate {
2111- projection_ty : ty:: AliasTy :: new ( tcx, obligation. predicate . def_id , trait_ref. args ) ,
2112- term : ty. into ( ) ,
2113- }
2114- } ) ;
2101+ let name = tcx. associated_item ( obligation. predicate . def_id ) . name ;
2102+ let ty = if name == sym:: Return {
2103+ return_ty
2104+ } else if name == sym:: Yield {
2105+ yield_ty
2106+ } else {
2107+ bug ! ( )
2108+ } ;
2109+
2110+ let predicate = ty:: ProjectionPredicate {
2111+ projection_ty : ty:: AliasTy :: new ( tcx, obligation. predicate . def_id , trait_ref. args ) ,
2112+ term : ty. into ( ) ,
2113+ } ;
21152114
2116- confirm_param_env_candidate ( selcx, obligation, predicate, false )
2115+ confirm_param_env_candidate ( selcx, obligation, ty :: Binder :: dummy ( predicate) , false )
21172116 . with_addl_obligations ( nested)
21182117 . with_addl_obligations ( obligations)
21192118}
@@ -2128,7 +2127,7 @@ fn confirm_future_candidate<'cx, 'tcx>(
21282127 else {
21292128 unreachable ! ( )
21302129 } ;
2131- let coroutine_sig = args. as_coroutine ( ) . poly_sig ( ) ;
2130+ let coroutine_sig = args. as_coroutine ( ) . sig ( ) ;
21322131 let Normalized { value : coroutine_sig, obligations } = normalize_with_depth (
21332132 selcx,
21342133 obligation. param_env ,
@@ -2142,22 +2141,21 @@ fn confirm_future_candidate<'cx, 'tcx>(
21422141 let tcx = selcx. tcx ( ) ;
21432142 let fut_def_id = tcx. require_lang_item ( LangItem :: Future , None ) ;
21442143
2145- let predicate = super :: util:: future_trait_ref_and_outputs (
2144+ let ( trait_ref , return_ty ) = super :: util:: future_trait_ref_and_outputs (
21462145 tcx,
21472146 fut_def_id,
21482147 obligation. predicate . self_ty ( ) ,
21492148 coroutine_sig,
2150- )
2151- . map_bound ( |( trait_ref, return_ty) | {
2152- debug_assert_eq ! ( tcx. associated_item( obligation. predicate. def_id) . name, sym:: Output ) ;
2149+ ) ;
21532150
2154- ty:: ProjectionPredicate {
2155- projection_ty : ty:: AliasTy :: new ( tcx, obligation. predicate . def_id , trait_ref. args ) ,
2156- term : return_ty. into ( ) ,
2157- }
2158- } ) ;
2151+ debug_assert_eq ! ( tcx. associated_item( obligation. predicate. def_id) . name, sym:: Output ) ;
2152+
2153+ let predicate = ty:: ProjectionPredicate {
2154+ projection_ty : ty:: AliasTy :: new ( tcx, obligation. predicate . def_id , trait_ref. args ) ,
2155+ term : return_ty. into ( ) ,
2156+ } ;
21592157
2160- confirm_param_env_candidate ( selcx, obligation, predicate, false )
2158+ confirm_param_env_candidate ( selcx, obligation, ty :: Binder :: dummy ( predicate) , false )
21612159 . with_addl_obligations ( nested)
21622160 . with_addl_obligations ( obligations)
21632161}
@@ -2172,7 +2170,7 @@ fn confirm_iterator_candidate<'cx, 'tcx>(
21722170 else {
21732171 unreachable ! ( )
21742172 } ;
2175- let gen_sig = args. as_coroutine ( ) . poly_sig ( ) ;
2173+ let gen_sig = args. as_coroutine ( ) . sig ( ) ;
21762174 let Normalized { value : gen_sig, obligations } = normalize_with_depth (
21772175 selcx,
21782176 obligation. param_env ,
@@ -2186,22 +2184,21 @@ fn confirm_iterator_candidate<'cx, 'tcx>(
21862184 let tcx = selcx. tcx ( ) ;
21872185 let iter_def_id = tcx. require_lang_item ( LangItem :: Iterator , None ) ;
21882186
2189- let predicate = super :: util:: iterator_trait_ref_and_outputs (
2187+ let ( trait_ref , yield_ty ) = super :: util:: iterator_trait_ref_and_outputs (
21902188 tcx,
21912189 iter_def_id,
21922190 obligation. predicate . self_ty ( ) ,
21932191 gen_sig,
2194- )
2195- . map_bound ( |( trait_ref, yield_ty) | {
2196- debug_assert_eq ! ( tcx. associated_item( obligation. predicate. def_id) . name, sym:: Item ) ;
2192+ ) ;
21972193
2198- ty:: ProjectionPredicate {
2199- projection_ty : ty:: AliasTy :: new ( tcx, obligation. predicate . def_id , trait_ref. args ) ,
2200- term : yield_ty. into ( ) ,
2201- }
2202- } ) ;
2194+ debug_assert_eq ! ( tcx. associated_item( obligation. predicate. def_id) . name, sym:: Item ) ;
22032195
2204- confirm_param_env_candidate ( selcx, obligation, predicate, false )
2196+ let predicate = ty:: ProjectionPredicate {
2197+ projection_ty : ty:: AliasTy :: new ( tcx, obligation. predicate . def_id , trait_ref. args ) ,
2198+ term : yield_ty. into ( ) ,
2199+ } ;
2200+
2201+ confirm_param_env_candidate ( selcx, obligation, ty:: Binder :: dummy ( predicate) , false )
22052202 . with_addl_obligations ( nested)
22062203 . with_addl_obligations ( obligations)
22072204}
0 commit comments