Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-schievink committed Mar 17, 2020
1 parent f79a95a commit b7fba97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/libcore/future/mod.rs
Expand Up @@ -47,7 +47,7 @@ unsafe impl Sync for ResumeTy {}
#[inline]
pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
where
T: Generator<ResumeTy, Yield = ()>
T: Generator<ResumeTy, Yield = ()>,
{
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
struct GenFuture<T: Generator<ResumeTy, Yield = ()>>(T);
Expand Down
10 changes: 3 additions & 7 deletions src/librustc_ast_lowering/expr.rs
Expand Up @@ -675,11 +675,8 @@ impl<'hir> LoweringContext<'_, 'hir> {

if let Some(task_context_hid) = self.task_context {
let lhs = self.expr_ident(span, task_context_ident, task_context_hid);
let assign = self.expr(
span,
hir::ExprKind::Assign(lhs, yield_expr, span),
AttrVec::new(),
);
let assign =
self.expr(span, hir::ExprKind::Assign(lhs, yield_expr, span), AttrVec::new());
self.stmt_expr(span, assign)
} else {
// Use of `await` outside of an async context. Return `yield_expr` so that we can
Expand All @@ -688,8 +685,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
};

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

// loop { ...; task_context = yield (); }
let loop_expr = self.arena.alloc(hir::Expr {
Expand Down

0 comments on commit b7fba97

Please sign in to comment.