diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-08-07 15:21:11 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-08-10 18:34:54 +0200 |
| commit | 970184528718d7c10579cac7b7e7e66ef2e2a3f5 (patch) | |
| tree | a44dde46934f594c8eaf16bf66d4eb2d4a39efbd /compiler/rustc_ast_lowering/src/expr.rs | |
| parent | 1603a70f82240ba2d27f72f964e36614d7620ad3 (diff) | |
| download | rust-970184528718d7c10579cac7b7e7e66ef2e2a3f5.tar.gz rust-970184528718d7c10579cac7b7e7e66ef2e2a3f5.zip | |
Do not consider method call receiver as an argument in AST.
Diffstat (limited to 'compiler/rustc_ast_lowering/src/expr.rs')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/expr.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index fb6715ff17e..c7d35fdb1fd 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -62,7 +62,7 @@ impl<'hir> LoweringContext<'_, 'hir> { hir::ExprKind::Call(f, self.lower_exprs(args)) } } - ExprKind::MethodCall(ref seg, ref args, span) => { + ExprKind::MethodCall(ref seg, ref receiver, ref args, span) => { let hir_seg = self.arena.alloc(self.lower_path_segment( e.span, seg, @@ -70,7 +70,9 @@ impl<'hir> LoweringContext<'_, 'hir> { ParenthesizedGenericArgs::Err, ImplTraitContext::Disallowed(ImplTraitPosition::Path), )); - let args = self.lower_exprs(args); + let args = self.arena.alloc_from_iter( + [&*receiver].into_iter().chain(args.iter()).map(|x| self.lower_expr_mut(x)), + ); hir::ExprKind::MethodCall(hir_seg, args, self.lower_span(span)) } ExprKind::Binary(binop, ref lhs, ref rhs) => { |
