Always pass the visitor as the first argument to walk* functions
This commit is contained in:
parent
754bdef793
commit
8d290058c9
10 changed files with 294 additions and 282 deletions
|
@ -3939,14 +3939,14 @@ impl MutVisitor for CondChecker<'_> {
|
|||
}
|
||||
}
|
||||
ExprKind::Binary(Spanned { node: BinOpKind::And, .. }, _, _) => {
|
||||
mut_visit::walk_expr(e, self);
|
||||
mut_visit::walk_expr(self, e);
|
||||
}
|
||||
ExprKind::Binary(Spanned { node: BinOpKind::Or, span: or_span }, _, _)
|
||||
if let None | Some(NotSupportedOr(_)) = self.forbid_let_reason =>
|
||||
{
|
||||
let forbid_let_reason = self.forbid_let_reason;
|
||||
self.forbid_let_reason = Some(NotSupportedOr(or_span));
|
||||
mut_visit::walk_expr(e, self);
|
||||
mut_visit::walk_expr(self, e);
|
||||
self.forbid_let_reason = forbid_let_reason;
|
||||
}
|
||||
ExprKind::Paren(ref inner)
|
||||
|
@ -3954,7 +3954,7 @@ impl MutVisitor for CondChecker<'_> {
|
|||
{
|
||||
let forbid_let_reason = self.forbid_let_reason;
|
||||
self.forbid_let_reason = Some(NotSupportedParentheses(inner.span));
|
||||
mut_visit::walk_expr(e, self);
|
||||
mut_visit::walk_expr(self, e);
|
||||
self.forbid_let_reason = forbid_let_reason;
|
||||
}
|
||||
ExprKind::Assign(ref lhs, _, span) => {
|
||||
|
@ -3972,7 +3972,7 @@ impl MutVisitor for CondChecker<'_> {
|
|||
}
|
||||
let comparison = self.comparison;
|
||||
self.comparison = Some(errors::MaybeComparison { span: span.shrink_to_hi() });
|
||||
mut_visit::walk_expr(e, self);
|
||||
mut_visit::walk_expr(self, e);
|
||||
self.forbid_let_reason = forbid_let_reason;
|
||||
self.missing_let = missing_let;
|
||||
self.comparison = comparison;
|
||||
|
@ -3992,7 +3992,7 @@ impl MutVisitor for CondChecker<'_> {
|
|||
| ExprKind::Paren(_) => {
|
||||
let forbid_let_reason = self.forbid_let_reason;
|
||||
self.forbid_let_reason = Some(OtherForbidden);
|
||||
mut_visit::walk_expr(e, self);
|
||||
mut_visit::walk_expr(self, e);
|
||||
self.forbid_let_reason = forbid_let_reason;
|
||||
}
|
||||
ExprKind::Cast(ref mut op, _) | ExprKind::Type(ref mut op, _) => {
|
||||
|
|
|
@ -810,7 +810,7 @@ impl<'a> Parser<'a> {
|
|||
self.0 = true;
|
||||
*m = Mutability::Mut;
|
||||
}
|
||||
walk_pat(pat, self);
|
||||
walk_pat(self, pat);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue