Rollup merge of #142371 - fee1-dead-contrib:push-xqlkumzurkus, r=petrochenkov

avoid `&mut P<T>` in `visit_expr` etc methods

trying a different way than rust-lang/rust#141636
r? ghost
This commit is contained in:
Jacob Pratt
2025-06-17 23:19:34 +02:00
committed by GitHub
11 changed files with 62 additions and 45 deletions

View File

@@ -4087,7 +4087,7 @@ impl<'a> CondChecker<'a> {
}
impl MutVisitor for CondChecker<'_> {
fn visit_expr(&mut self, e: &mut P<Expr>) {
fn visit_expr(&mut self, e: &mut Expr) {
self.depth += 1;
use ForbiddenLetReason::*;

View File

@@ -1094,7 +1094,7 @@ impl<'a> Parser<'a> {
fn make_all_value_bindings_mutable(pat: &mut P<Pat>) -> bool {
struct AddMut(bool);
impl MutVisitor for AddMut {
fn visit_pat(&mut self, pat: &mut P<Pat>) {
fn visit_pat(&mut self, pat: &mut Pat) {
if let PatKind::Ident(BindingMode(ByRef::No, m @ Mutability::Not), ..) =
&mut pat.kind
{