Make sure the call span parens check only fires on the callee, not args
This commit is contained in:
parent
e5c2412e52
commit
d98892b67f
@ -1842,10 +1842,11 @@ fn ban_take_value_of_method(&self, expr: &hir::Expr<'_>, expr_t: Ty<'tcx>, field
|
||||
expr_t
|
||||
);
|
||||
err.span_label(field.span, "method, not a field");
|
||||
let expr_is_call = if let hir::Node::Expr(parent_expr) =
|
||||
let expr_is_call =
|
||||
if let hir::Node::Expr(hir::Expr { kind: ExprKind::Call(callee, _args), .. }) =
|
||||
self.tcx.hir().get(self.tcx.hir().get_parent_node(expr.hir_id))
|
||||
{
|
||||
matches!(parent_expr.kind, ExprKind::Call(..))
|
||||
expr.hir_id == callee.hir_id
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user