diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2025-08-09 13:24:06 +0800 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2025-08-09 15:47:01 +0800 |
| commit | ad1113f87ef828b300ebb8fca397efd358580da3 (patch) | |
| tree | 1698ee8e278895989d53e13aa569f1c9601b4d19 /compiler/rustc_ast_pretty | |
| parent | 4c7749e8c8e50ad146da599eea3a250160c1bc2b (diff) | |
| download | rust-ad1113f87ef828b300ebb8fca397efd358580da3.tar.gz rust-ad1113f87ef828b300ebb8fca397efd358580da3.zip | |
remove `P`
Diffstat (limited to 'compiler/rustc_ast_pretty')
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state/expr.rs | 13 | ||||
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state/item.rs | 5 |
3 files changed, 9 insertions, 12 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index f0cf0c1487f..85f76036df7 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -10,7 +10,6 @@ use std::borrow::Cow; use std::sync::Arc; use rustc_ast::attr::AttrIdGenerator; -use rustc_ast::ptr::P; use rustc_ast::token::{self, CommentKind, Delimiter, IdentIsRaw, Token, TokenKind}; use rustc_ast::tokenstream::{Spacing, TokenStream, TokenTree}; use rustc_ast::util::classify; @@ -1178,7 +1177,7 @@ impl<'a> State<'a> { self.end(rb); } - fn commasep_exprs(&mut self, b: Breaks, exprs: &[P<ast::Expr>]) { + fn commasep_exprs(&mut self, b: Breaks, exprs: &[Box<ast::Expr>]) { self.commasep_cmnt(b, exprs, |s, e| s.print_expr(e, FixupContext::default()), |e| e.span) } diff --git a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs index 8a2cb64b2a0..bdf73ac32f0 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs @@ -2,7 +2,6 @@ use std::fmt::Write; use ast::{ForLoopKind, MatchKind}; use itertools::{Itertools, Position}; -use rustc_ast::ptr::P; use rustc_ast::util::classify; use rustc_ast::util::literal::escape_byte_str_symbol; use rustc_ast::util::parser::{self, ExprPrecedence, Fixity}; @@ -54,7 +53,7 @@ impl<'a> State<'a> { self.print_else(elseopt) } - fn print_call_post(&mut self, args: &[P<ast::Expr>]) { + fn print_call_post(&mut self, args: &[Box<ast::Expr>]) { self.popen(); self.commasep_exprs(Inconsistent, args); self.pclose() @@ -111,7 +110,7 @@ impl<'a> State<'a> { } } - fn print_expr_vec(&mut self, exprs: &[P<ast::Expr>]) { + fn print_expr_vec(&mut self, exprs: &[Box<ast::Expr>]) { let ib = self.ibox(INDENT_UNIT); self.word("["); self.commasep_exprs(Inconsistent, exprs); @@ -149,7 +148,7 @@ impl<'a> State<'a> { fn print_expr_struct( &mut self, - qself: &Option<P<ast::QSelf>>, + qself: &Option<Box<ast::QSelf>>, path: &ast::Path, fields: &[ast::ExprField], rest: &ast::StructRest, @@ -204,7 +203,7 @@ impl<'a> State<'a> { self.word("}"); } - fn print_expr_tup(&mut self, exprs: &[P<ast::Expr>]) { + fn print_expr_tup(&mut self, exprs: &[Box<ast::Expr>]) { self.popen(); self.commasep_exprs(Inconsistent, exprs); if exprs.len() == 1 { @@ -213,7 +212,7 @@ impl<'a> State<'a> { self.pclose() } - fn print_expr_call(&mut self, func: &ast::Expr, args: &[P<ast::Expr>], fixup: FixupContext) { + fn print_expr_call(&mut self, func: &ast::Expr, args: &[Box<ast::Expr>], fixup: FixupContext) { // Independent of parenthesization related to precedence, we must // parenthesize `func` if this is a statement context in which without // parentheses, a statement boundary would occur inside `func` or @@ -247,7 +246,7 @@ impl<'a> State<'a> { &mut self, segment: &ast::PathSegment, receiver: &ast::Expr, - base_args: &[P<ast::Expr>], + base_args: &[Box<ast::Expr>], fixup: FixupContext, ) { // The fixup here is different than in `print_expr_call` because diff --git a/compiler/rustc_ast_pretty/src/pprust/state/item.rs b/compiler/rustc_ast_pretty/src/pprust/state/item.rs index 11c97a552c6..6e34d1b61db 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state/item.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state/item.rs @@ -2,7 +2,6 @@ use ast::StaticItem; use itertools::{Itertools, Position}; use rustc_ast as ast; use rustc_ast::ModKind; -use rustc_ast::ptr::P; use rustc_span::Ident; use crate::pp::BoxMarker; @@ -628,10 +627,10 @@ impl<'a> State<'a> { &mut self, attrs: &[ast::Attribute], vis: &ast::Visibility, - qself: &Option<P<ast::QSelf>>, + qself: &Option<Box<ast::QSelf>>, path: &ast::Path, kind: DelegationKind<'_>, - body: &Option<P<ast::Block>>, + body: &Option<Box<ast::Block>>, ) { let body_cb_ib = body.as_ref().map(|body| (body, self.head(""))); self.print_visibility(vis); |
