Do not consider method call receiver as an argument in AST.
This commit is contained in:
parent
1603a70f82
commit
9701845287
19 changed files with 107 additions and 55 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue