@@ -1680,14 +1680,8 @@ fn confirm_closure_candidate<'cx, 'tcx>(
16801680 args. coroutine_captures_by_ref_ty ( ) ,
16811681 )
16821682 } else {
1683- let async_fn_kind_trait_def_id =
1684- tcx. require_lang_item ( LangItem :: AsyncFnKindHelper , None ) ;
1685- let upvars_projection_def_id = tcx
1686- . associated_items ( async_fn_kind_trait_def_id)
1687- . filter_by_name_unhygienic ( sym:: Upvars )
1688- . next ( )
1689- . unwrap ( )
1690- . def_id ;
1683+ let upvars_projection_def_id =
1684+ tcx. require_lang_item ( LangItem :: AsyncFnKindUpvars , None ) ;
16911685 let tupled_upvars_ty = Ty :: new_projection (
16921686 tcx,
16931687 upvars_projection_def_id,
@@ -1816,14 +1810,8 @@ fn confirm_async_closure_candidate<'cx, 'tcx>(
18161810 args. coroutine_captures_by_ref_ty ( ) ,
18171811 )
18181812 } else {
1819- let async_fn_kind_trait_def_id =
1820- tcx. require_lang_item ( LangItem :: AsyncFnKindHelper , None ) ;
1821- let upvars_projection_def_id = tcx
1822- . associated_items ( async_fn_kind_trait_def_id)
1823- . filter_by_name_unhygienic ( sym:: Upvars )
1824- . next ( )
1825- . unwrap ( )
1826- . def_id ;
1813+ let upvars_projection_def_id =
1814+ tcx. require_lang_item ( LangItem :: AsyncFnKindUpvars , None ) ;
18271815 // When we don't know the closure kind (and therefore also the closure's upvars,
18281816 // which are computed at the same time), we must delay the computation of the
18291817 // generator's upvars. We do this using the `AsyncFnKindHelper`, which as a trait
@@ -1880,13 +1868,7 @@ fn confirm_async_closure_candidate<'cx, 'tcx>(
18801868 let term = match item_name {
18811869 sym:: CallOnceFuture | sym:: CallRefFuture => sig. output ( ) ,
18821870 sym:: Output => {
1883- let future_trait_def_id = tcx. require_lang_item ( LangItem :: Future , None ) ;
1884- let future_output_def_id = tcx
1885- . associated_items ( future_trait_def_id)
1886- . filter_by_name_unhygienic ( sym:: Output )
1887- . next ( )
1888- . unwrap ( )
1889- . def_id ;
1871+ let future_output_def_id = tcx. require_lang_item ( LangItem :: FutureOutput , None ) ;
18901872 Ty :: new_projection ( tcx, future_output_def_id, [ sig. output ( ) ] )
18911873 }
18921874 name => bug ! ( "no such associated type: {name}" ) ,
@@ -1919,13 +1901,7 @@ fn confirm_async_closure_candidate<'cx, 'tcx>(
19191901 let term = match item_name {
19201902 sym:: CallOnceFuture | sym:: CallRefFuture => sig. output ( ) ,
19211903 sym:: Output => {
1922- let future_trait_def_id = tcx. require_lang_item ( LangItem :: Future , None ) ;
1923- let future_output_def_id = tcx
1924- . associated_items ( future_trait_def_id)
1925- . filter_by_name_unhygienic ( sym:: Output )
1926- . next ( )
1927- . unwrap ( )
1928- . def_id ;
1904+ let future_output_def_id = tcx. require_lang_item ( LangItem :: FutureOutput , None ) ;
19291905 Ty :: new_projection ( tcx, future_output_def_id, [ sig. output ( ) ] )
19301906 }
19311907 name => bug ! ( "no such associated type: {name}" ) ,
0 commit comments