diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-06-11 21:25:25 +0200 | 
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-06-12 00:16:27 +0200 | 
| commit | 3039cfeb6a24c65ab4b7d25f1c60dc0a5df836ac (patch) | |
| tree | 66c3a317d49d7fb64829d951b6d38f4b8ffff2ec /compiler/rustc_passes/src/loops.rs | |
| parent | fa68e73e9947be8ffc5b3b46d899e4953a44e7e9 (diff) | |
| download | rust-3039cfeb6a24c65ab4b7d25f1c60dc0a5df836ac.tar.gz rust-3039cfeb6a24c65ab4b7d25f1c60dc0a5df836ac.zip | |
Make `ExprKind::Closure` a struct variant.
Diffstat (limited to 'compiler/rustc_passes/src/loops.rs')
| -rw-r--r-- | compiler/rustc_passes/src/loops.rs | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/compiler/rustc_passes/src/loops.rs b/compiler/rustc_passes/src/loops.rs index e0dac09870d..191a682e8b1 100644 --- a/compiler/rustc_passes/src/loops.rs +++ b/compiler/rustc_passes/src/loops.rs @@ -57,14 +57,14 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> { hir::ExprKind::Loop(ref b, _, source, _) => { self.with_context(Loop(source), |v| v.visit_block(&b)); } - hir::ExprKind::Closure(_, ref function_decl, b, span, movability) => { + hir::ExprKind::Closure { ref fn_decl, body, fn_decl_span, movability, .. } => { let cx = if let Some(Movability::Static) = movability { - AsyncClosure(span) + AsyncClosure(fn_decl_span) } else { - Closure(span) + Closure(fn_decl_span) }; - self.visit_fn_decl(&function_decl); - self.with_context(cx, |v| v.visit_nested_body(b)); + self.visit_fn_decl(&fn_decl); + self.with_context(cx, |v| v.visit_nested_body(body)); } hir::ExprKind::Block(ref b, Some(_label)) => { self.with_context(LabeledBlock, |v| v.visit_block(&b)); | 
