diff options
Diffstat (limited to 'compiler/rustc_hir/src/hir.rs')
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 2f5f271dc50..60f8bb51d65 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1651,7 +1651,7 @@ impl Expr<'_> { ExprKind::Let(..) => ExprPrecedence::Let, ExprKind::Loop(..) => ExprPrecedence::Loop, ExprKind::Match(..) => ExprPrecedence::Match, - ExprKind::Closure(..) => ExprPrecedence::Closure, + ExprKind::Closure { .. } => ExprPrecedence::Closure, ExprKind::Block(..) => ExprPrecedence::Block, ExprKind::Assign(..) => ExprPrecedence::Assign, ExprKind::AssignOp(..) => ExprPrecedence::AssignOp, @@ -1711,7 +1711,7 @@ impl Expr<'_> { | ExprKind::Tup(..) | ExprKind::If(..) | ExprKind::Match(..) - | ExprKind::Closure(..) + | ExprKind::Closure { .. } | ExprKind::Block(..) | ExprKind::Repeat(..) | ExprKind::Array(..) @@ -1794,7 +1794,7 @@ impl Expr<'_> { | ExprKind::Match(..) | ExprKind::MethodCall(..) | ExprKind::Call(..) - | ExprKind::Closure(..) + | ExprKind::Closure { .. } | ExprKind::Block(..) | ExprKind::Repeat(..) | ExprKind::Break(..) @@ -1929,7 +1929,13 @@ pub enum ExprKind<'hir> { /// /// This may also be a generator literal or an `async block` as indicated by the /// `Option<Movability>`. - Closure(CaptureBy, &'hir FnDecl<'hir>, BodyId, Span, Option<Movability>), + Closure { + capture_clause: CaptureBy, + fn_decl: &'hir FnDecl<'hir>, + body: BodyId, + fn_decl_span: Span, + movability: Option<Movability>, + }, /// A block (e.g., `'label: { ... }`). Block(&'hir Block<'hir>, Option<Label>), @@ -3455,7 +3461,7 @@ impl<'hir> Node<'hir> { _ => None, }, Node::Expr(e) => match e.kind { - ExprKind::Closure(..) => Some(FnKind::Closure), + ExprKind::Closure { .. } => Some(FnKind::Closure), _ => None, }, _ => None, |
