diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2025-06-12 00:02:12 +0800 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2025-06-12 17:36:03 +0800 |
| commit | 5f0dd44b3b1b142582d3dc8264cb2b8dd8f7c7f0 (patch) | |
| tree | 489a5717781e2dd30534e2b3e64c7eb5556fca97 /compiler/rustc_expand/src/placeholders.rs | |
| parent | 14346303d760027e53214e705109a62c0f00b214 (diff) | |
| download | rust-5f0dd44b3b1b142582d3dc8264cb2b8dd8f7c7f0.tar.gz rust-5f0dd44b3b1b142582d3dc8264cb2b8dd8f7c7f0.zip | |
avoid `&mut P<T>` in `visit_expr` etc methods
Diffstat (limited to 'compiler/rustc_expand/src/placeholders.rs')
| -rw-r--r-- | compiler/rustc_expand/src/placeholders.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_expand/src/placeholders.rs b/compiler/rustc_expand/src/placeholders.rs index 3dcb20c8c76..2c486a02bdf 100644 --- a/compiler/rustc_expand/src/placeholders.rs +++ b/compiler/rustc_expand/src/placeholders.rs @@ -332,9 +332,9 @@ impl MutVisitor for PlaceholderExpander { } } - fn visit_expr(&mut self, expr: &mut P<ast::Expr>) { + fn visit_expr(&mut self, expr: &mut ast::Expr) { match expr.kind { - ast::ExprKind::MacCall(_) => *expr = self.remove(expr.id).make_expr(), + ast::ExprKind::MacCall(_) => *expr = *self.remove(expr.id).make_expr(), _ => walk_expr(self, expr), } } @@ -399,16 +399,16 @@ impl MutVisitor for PlaceholderExpander { stmts } - fn visit_pat(&mut self, pat: &mut P<ast::Pat>) { + fn visit_pat(&mut self, pat: &mut ast::Pat) { match pat.kind { - ast::PatKind::MacCall(_) => *pat = self.remove(pat.id).make_pat(), + ast::PatKind::MacCall(_) => *pat = *self.remove(pat.id).make_pat(), _ => walk_pat(self, pat), } } - fn visit_ty(&mut self, ty: &mut P<ast::Ty>) { + fn visit_ty(&mut self, ty: &mut ast::Ty) { match ty.kind { - ast::TyKind::MacCall(_) => *ty = self.remove(ty.id).make_ty(), + ast::TyKind::MacCall(_) => *ty = *self.remove(ty.id).make_ty(), _ => walk_ty(self, ty), } } |
