From 9730221b9d8adafcd7615d5dc43cf83a60baf123 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Thu, 23 Jun 2022 12:21:23 +0400 Subject: [PATCH] Remove excess rib while resolving closures --- compiler/rustc_resolve/src/late.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index e36f55b2e0237..640d13ea43547 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -3514,7 +3514,9 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { }) }); } - ExprKind::Async(..) | ExprKind::Closure(..) => { + // For closures, ClosureOrAsyncRibKind is added in visit_fn + ExprKind::Closure(..) => visit::walk_expr(self, expr), + ExprKind::Async(..) => { self.with_label_rib(ClosureOrAsyncRibKind, |this| visit::walk_expr(this, expr)); } ExprKind::Repeat(ref elem, ref ct) => {