about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-08-22 10:27:12 +0000
committerbors <bors@rust-lang.org>2025-08-22 10:27:12 +0000
commitf5703d5dd3eec176f86a6e9bf7e668b48b84eabb (patch)
tree3ed1c84b426859a59f2012bb765f4412c7eafe19 /compiler/rustc_parse/src/parser/expr.rs
parent831e291d3be4cacc4fe178424c4d6baa264d8b5a (diff)
parentec5b2cce8e0e409e7c4bbcec332fba7c70c142ec (diff)
downloadrust-f5703d5dd3eec176f86a6e9bf7e668b48b84eabb.tar.gz
rust-f5703d5dd3eec176f86a6e9bf7e668b48b84eabb.zip
Auto merge of #144689 - JonathanBrouwer:share_parse_path, r=jdonszelmann
Rewrite the new attribute argument parser

Fixes https://github.com/rust-lang/rust/issues/143940

This rewrites the parser, should improve performance and maintainability.
This can be reviewed commit by commit
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index cb7f755f524..6aa6fc2c790 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -2077,7 +2077,7 @@ impl<'a> Parser<'a> {
         (token::Lit { symbol: name, suffix: None, kind: token::Char }, span)
     }
 
-    fn mk_meta_item_lit_char(name: Symbol, span: Span) -> MetaItemLit {
+    pub fn mk_meta_item_lit_char(name: Symbol, span: Span) -> MetaItemLit {
         ast::MetaItemLit {
             symbol: name,
             suffix: None,
@@ -2086,7 +2086,7 @@ impl<'a> Parser<'a> {
         }
     }
 
-    fn handle_missing_lit<L>(
+    pub fn handle_missing_lit<L>(
         &mut self,
         mk_lit_char: impl FnOnce(Symbol, Span) -> L,
     ) -> PResult<'a, L> {
@@ -2156,7 +2156,7 @@ impl<'a> Parser<'a> {
 
     /// Keep this in sync with `Token::can_begin_literal_maybe_minus` and
     /// `Lit::from_token` (excluding unary negation).
-    fn eat_token_lit(&mut self) -> Option<token::Lit> {
+    pub fn eat_token_lit(&mut self) -> Option<token::Lit> {
         let check_expr = |expr: Box<Expr>| {
             if let ast::ExprKind::Lit(token_lit) = expr.kind {
                 Some(token_lit)