@@ -1680,14 +1680,8 @@ fn confirm_closure_candidate<'cx, 'tcx>(
1680
1680
args. coroutine_captures_by_ref_ty ( ) ,
1681
1681
)
1682
1682
} 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 ) ;
1691
1685
let tupled_upvars_ty = Ty :: new_projection (
1692
1686
tcx,
1693
1687
upvars_projection_def_id,
@@ -1816,14 +1810,8 @@ fn confirm_async_closure_candidate<'cx, 'tcx>(
1816
1810
args. coroutine_captures_by_ref_ty ( ) ,
1817
1811
)
1818
1812
} 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 ) ;
1827
1815
// When we don't know the closure kind (and therefore also the closure's upvars,
1828
1816
// which are computed at the same time), we must delay the computation of the
1829
1817
// generator's upvars. We do this using the `AsyncFnKindHelper`, which as a trait
@@ -1880,13 +1868,7 @@ fn confirm_async_closure_candidate<'cx, 'tcx>(
1880
1868
let term = match item_name {
1881
1869
sym:: CallOnceFuture | sym:: CallRefFuture => sig. output ( ) ,
1882
1870
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 ) ;
1890
1872
Ty :: new_projection ( tcx, future_output_def_id, [ sig. output ( ) ] )
1891
1873
}
1892
1874
name => bug ! ( "no such associated type: {name}" ) ,
@@ -1919,13 +1901,7 @@ fn confirm_async_closure_candidate<'cx, 'tcx>(
1919
1901
let term = match item_name {
1920
1902
sym:: CallOnceFuture | sym:: CallRefFuture => sig. output ( ) ,
1921
1903
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 ) ;
1929
1905
Ty :: new_projection ( tcx, future_output_def_id, [ sig. output ( ) ] )
1930
1906
}
1931
1907
name => bug ! ( "no such associated type: {name}" ) ,
0 commit comments