@@ -865,6 +865,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
865865 } ;
866866
867867 let features = match await_kind {
868+ FutureKind :: Future if is_async_gen => Some ( Arc :: clone ( & self . allow_async_gen ) ) ,
868869 FutureKind :: Future => None ,
869870 FutureKind :: AsyncIterator => Some ( Arc :: clone ( & self . allow_for_await ) ) ,
870871 } ;
@@ -901,23 +902,23 @@ impl<'hir> LoweringContext<'_, 'hir> {
901902
902903 let task_context = self . expr_ident_mut ( span, task_context_ident, task_context_hid) ;
903904
904- let new_unchecked = self . expr_call_lang_item_qpath_fn_mut (
905+ let new_unchecked = self . expr_call_lang_item_fn_mut (
905906 span,
906907 hir:: LangItem :: PinNewUnchecked ,
907908 arena_vec ! [ self ; ref_mut_awaitee] ,
908909 ) ;
909- let get_context = self . expr_call_lang_item_qpath_fn_mut (
910+ let get_context = self . expr_call_lang_item_fn_mut (
910911 gen_future_span,
911912 hir:: LangItem :: GetContext ,
912913 arena_vec ! [ self ; task_context] ,
913914 ) ;
914915 let call = match await_kind {
915- FutureKind :: Future => self . expr_call_lang_item_qpath_fn (
916+ FutureKind :: Future => self . expr_call_lang_item_fn (
916917 span,
917918 hir:: LangItem :: FuturePoll ,
918919 arena_vec ! [ self ; new_unchecked, get_context] ,
919920 ) ,
920- FutureKind :: AsyncIterator => self . expr_call_lang_item_qpath_fn (
921+ FutureKind :: AsyncIterator => self . expr_call_lang_item_fn (
921922 span,
922923 hir:: LangItem :: AsyncIteratorPollNext ,
923924 arena_vec ! [ self ; new_unchecked, get_context] ,
@@ -965,7 +966,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
965966 // async gen - task_context = yield ASYNC_GEN_PENDING;
966967 let yield_stmt = {
967968 let yielded = if is_async_gen {
968- self . arena . alloc ( self . expr_lang_item_qpath ( span, hir:: LangItem :: AsyncGenPending ) )
969+ self . arena . alloc ( self . expr_lang_item_path ( span, hir:: LangItem :: AsyncGenPending ) )
969970 } else {
970971 self . expr_unit ( span)
971972 } ;
@@ -1005,7 +1006,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10051006
10061007 // `match ::std::future::IntoFuture::into_future(<expr>) { ... }`
10071008 let into_future_expr = match await_kind {
1008- FutureKind :: Future => self . expr_call_lang_item_qpath_fn (
1009+ FutureKind :: Future => self . expr_call_lang_item_fn (
10091010 span,
10101011 hir:: LangItem :: IntoFutureIntoFuture ,
10111012 arena_vec ! [ self ; * expr] ,
@@ -1720,8 +1721,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
17201721 // `yield $expr` is transformed into `task_context = yield async_gen_ready($expr)`.
17211722 // This ensures that we store our resumed `ResumeContext` correctly, and also that
17221723 // the apparent value of the `yield` expression is `()`.
1723- let wrapped_yielded = self . expr_call_lang_item_qpath_fn (
1724- span,
1724+ let wrapped_yielded = self . expr_call_lang_item_fn (
1725+ self . mark_span_with_reason (
1726+ DesugaringKind :: Async ,
1727+ span,
1728+ Some ( Arc :: clone ( & self . allow_async_gen ) ) ,
1729+ ) ,
17251730 hir:: LangItem :: AsyncGenReady ,
17261731 std:: slice:: from_ref ( yielded) ,
17271732 ) ;
0 commit comments