Skip to content

Commit 37b5bfc

Browse files
Improve comments in HIR lowering code
1 parent b7fba97 commit 37b5bfc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_ast_lowering/expr.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
561561
/// ::std::task::Poll::Ready(result) => break result,
562562
/// ::std::task::Poll::Pending => {}
563563
/// }
564-
/// yield ();
564+
/// task_context = yield ();
565565
/// }
566566
/// }
567567
/// ```
@@ -664,6 +664,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
664664
self.stmt_expr(span, match_expr)
665665
};
666666

667+
// task_context = yield ();
667668
let yield_stmt = {
668669
let unit = self.expr_unit(span);
669670
let yield_expr = self.expr(
@@ -687,7 +688,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
687688

688689
let loop_block = self.block_all(span, arena_vec![self; inner_match_stmt, yield_stmt], None);
689690

690-
// loop { ...; task_context = yield (); }
691+
// loop { .. }
691692
let loop_expr = self.arena.alloc(hir::Expr {
692693
hir_id: loop_hir_id,
693694
kind: hir::ExprKind::Loop(loop_block, None, hir::LoopSource::Loop),

0 commit comments

Comments
 (0)