diff options
| author | Sarthak Singh <ss269@uw.edu> | 2022-11-09 20:39:28 +0530 |
|---|---|---|
| committer | Sarthak Singh <ss269@uw.edu> | 2022-11-28 14:09:00 +0530 |
| commit | 8f705e2425ff459566cd1da0f2c79060fdad9091 (patch) | |
| tree | a89e14443b862c7334dfbaa63f8c2fb9147f4894 /compiler/rustc_ast_lowering/src | |
| parent | 872631d0f0fadffe3220ab1bd9c8f1f2342341e2 (diff) | |
| download | rust-8f705e2425ff459566cd1da0f2c79060fdad9091.tar.gz rust-8f705e2425ff459566cd1da0f2c79060fdad9091.zip | |
Keep track of the start of the argument block of a closure
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/expr.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index a00100ee0a8..4385552f2cc 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -176,6 +176,7 @@ impl<'hir> LoweringContext<'_, 'hir> { fn_decl, body, fn_decl_span, + fn_arg_span, }) => { if let Async::Yes { closure_id, .. } = asyncness { self.lower_expr_async_closure( @@ -186,6 +187,7 @@ impl<'hir> LoweringContext<'_, 'hir> { fn_decl, body, *fn_decl_span, + *fn_arg_span, ) } else { self.lower_expr_closure( @@ -196,6 +198,7 @@ impl<'hir> LoweringContext<'_, 'hir> { fn_decl, body, *fn_decl_span, + *fn_arg_span, ) } } @@ -639,6 +642,7 @@ impl<'hir> LoweringContext<'_, 'hir> { fn_decl, body, fn_decl_span: self.lower_span(span), + fn_arg_span: None, movability: Some(hir::Movability::Static), }); @@ -887,6 +891,7 @@ impl<'hir> LoweringContext<'_, 'hir> { decl: &FnDecl, body: &Expr, fn_decl_span: Span, + fn_arg_span: Span, ) -> hir::ExprKind<'hir> { let (binder_clause, generic_params) = self.lower_closure_binder(binder); @@ -917,6 +922,7 @@ impl<'hir> LoweringContext<'_, 'hir> { fn_decl, body: body_id, fn_decl_span: self.lower_span(fn_decl_span), + fn_arg_span: Some(self.lower_span(fn_arg_span)), movability: generator_option, }); @@ -973,6 +979,7 @@ impl<'hir> LoweringContext<'_, 'hir> { decl: &FnDecl, body: &Expr, fn_decl_span: Span, + fn_arg_span: Span, ) -> hir::ExprKind<'hir> { if let &ClosureBinder::For { span, .. } = binder { self.tcx.sess.emit_err(NotSupportedForLifetimeBinderAsyncClosure { span }); @@ -1027,6 +1034,7 @@ impl<'hir> LoweringContext<'_, 'hir> { fn_decl, body, fn_decl_span: self.lower_span(fn_decl_span), + fn_arg_span: Some(self.lower_span(fn_arg_span)), movability: None, }); hir::ExprKind::Closure(c) |
