From ad1113f87ef828b300ebb8fca397efd358580da3 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Sat, 9 Aug 2025 13:24:06 +0800 Subject: remove `P` --- compiler/rustc_parse/src/parser/mod.rs | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'compiler/rustc_parse/src/parser/mod.rs') diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 90491e53249..0a8a0203013 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -25,7 +25,6 @@ pub(crate) use expr::ForbiddenLetReason; pub(crate) use item::FnParseMode; pub use pat::{CommaRecoveryMode, RecoverColon, RecoverComma}; use path::PathStyle; -use rustc_ast::ptr::P; use rustc_ast::token::{ self, IdentIsRaw, InvisibleOrigin, MetaVarKind, NtExprKind, NtPatKind, Token, TokenKind, }; @@ -1286,7 +1285,7 @@ impl<'a> Parser<'a> { } /// Parses inline const expressions. - fn parse_const_block(&mut self, span: Span, pat: bool) -> PResult<'a, P> { + fn parse_const_block(&mut self, span: Span, pat: bool) -> PResult<'a, Box> { self.expect_keyword(exp!(Const))?; let (attrs, blk) = self.parse_inner_attrs_and_block(None)?; let anon_const = AnonConst { @@ -1343,9 +1342,9 @@ impl<'a> Parser<'a> { } } - fn parse_delim_args(&mut self) -> PResult<'a, P> { + fn parse_delim_args(&mut self) -> PResult<'a, Box> { if let Some(args) = self.parse_delim_args_inner() { - Ok(P(args)) + Ok(Box::new(args)) } else { self.unexpected_any() } @@ -1470,7 +1469,7 @@ impl<'a> Parser<'a> { let path = self.parse_path(PathStyle::Mod)?; // `path` self.expect(exp!(CloseParen))?; // `)` let vis = VisibilityKind::Restricted { - path: P(path), + path: Box::new(path), id: ast::DUMMY_NODE_ID, shorthand: false, }; @@ -1487,7 +1486,7 @@ impl<'a> Parser<'a> { let path = self.parse_path(PathStyle::Mod)?; // `crate`/`super`/`self` self.expect(exp!(CloseParen))?; // `)` let vis = VisibilityKind::Restricted { - path: P(path), + path: Box::new(path), id: ast::DUMMY_NODE_ID, shorthand: true, }; @@ -1652,14 +1651,14 @@ pub enum ParseNtResult { Tt(TokenTree), Ident(Ident, IdentIsRaw), Lifetime(Ident, IdentIsRaw), - Item(P), - Block(P), - Stmt(P), - Pat(P, NtPatKind), - Expr(P, NtExprKind), - Literal(P), - Ty(P), - Meta(P), - Path(P), - Vis(P), + Item(Box), + Block(Box), + Stmt(Box), + Pat(Box, NtPatKind), + Expr(Box, NtExprKind), + Literal(Box), + Ty(Box), + Meta(Box), + Path(Box), + Vis(Box), } -- cgit 1.4.1-3-g733a5