File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
compiler/rustc_ast_lowering/src Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1721,12 +1721,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
17211721 // `yield $expr` is transformed into `task_context = yield async_gen_ready($expr)`.
17221722 // This ensures that we store our resumed `ResumeContext` correctly, and also that
17231723 // the apparent value of the `yield` expression is `()`.
1724+ let desugar_span = self . mark_span_with_reason (
1725+ DesugaringKind :: Async ,
1726+ span,
1727+ Some ( Arc :: clone ( & self . allow_async_gen ) ) ,
1728+ ) ;
17241729 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- ) ,
1730+ desugar_span,
17301731 hir:: LangItem :: AsyncGenReady ,
17311732 std:: slice:: from_ref ( yielded) ,
17321733 ) ;
@@ -1738,7 +1739,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
17381739 unreachable ! ( "use of `await` outside of an async context." ) ;
17391740 } ;
17401741 let task_context_ident = Ident :: with_dummy_span ( sym:: _task_context) ;
1741- let lhs = self . expr_ident ( span , task_context_ident, task_context_hid) ;
1742+ let lhs = self . expr_ident ( desugar_span , task_context_ident, task_context_hid) ;
17421743
17431744 hir:: ExprKind :: Assign ( lhs, yield_expr, self . lower_span ( span) )
17441745 } else {
You can’t perform that action at this time.
0 commit comments