diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-06-02 20:15:05 +0400 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-07-12 16:25:16 +0400 |
| commit | 40ae7b5b8e09da657b62bc849b8bcdf99a1cb210 (patch) | |
| tree | f2a08c2651b0cb786a37697ee7806b272c01bb1d /compiler/rustc_resolve | |
| parent | fbdb07f4e7f4666085aec4b1ed2fd05817dc42cf (diff) | |
| download | rust-40ae7b5b8e09da657b62bc849b8bcdf99a1cb210.tar.gz rust-40ae7b5b8e09da657b62bc849b8bcdf99a1cb210.zip | |
Parse closure binders
This is first step in implementing RFC 3216. - Parse `for<'a>` before closures in ast - Error in lowering - Add `closure_lifetime_binder` feature
Diffstat (limited to 'compiler/rustc_resolve')
| -rw-r--r-- | compiler/rustc_resolve/src/def_collector.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/late.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index 52706fbb9e6..66641fb2cb2 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -259,7 +259,7 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> { fn visit_expr(&mut self, expr: &'a Expr) { let parent_def = match expr.kind { ExprKind::MacCall(..) => return self.visit_macro_invoc(expr.id), - ExprKind::Closure(_, asyncness, ..) => { + ExprKind::Closure(_, _, asyncness, ..) => { // Async closures desugar to closures inside of closures, so // we must create two defs. let closure_def = self.create_def(expr.id, DefPathData::ClosureExpr, expr.span); diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 640d13ea435..caf6f8c8392 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -3495,7 +3495,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { // `async |x| ...` gets desugared to `|x| future_from_generator(|| ...)`, so we need to // resolve the arguments within the proper scopes so that usages of them inside the // closure are detected as upvars rather than normal closure arg usages. - ExprKind::Closure(_, Async::Yes { .. }, _, ref fn_decl, ref body, _span) => { + ExprKind::Closure(_, _, Async::Yes { .. }, _, ref fn_decl, ref body, _span) => { self.with_rib(ValueNS, NormalRibKind, |this| { this.with_label_rib(ClosureOrAsyncRibKind, |this| { // Resolve arguments: |
