Skip to content

Commit

Permalink
Improve comments in HIR lowering code
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-schievink committed Mar 17, 2020
1 parent b7fba97 commit 37b5bfc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_ast_lowering/expr.rs
Expand Up @@ -561,7 +561,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
/// ::std::task::Poll::Ready(result) => break result,
/// ::std::task::Poll::Pending => {}
/// }
/// yield ();
/// task_context = yield ();
/// }
/// }
/// ```
Expand Down Expand Up @@ -664,6 +664,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
self.stmt_expr(span, match_expr)
};

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

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

// loop { ...; task_context = yield (); }
// loop { .. }
let loop_expr = self.arena.alloc(hir::Expr {
hir_id: loop_hir_id,
kind: hir::ExprKind::Loop(loop_block, None, hir::LoopSource::Loop),
Expand Down

0 comments on commit 37b5bfc

Please sign in to comment.