about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2025-02-05 08:22:20 +0100
committerLukas Wirth <lukastw97@gmail.com>2025-02-05 08:22:20 +0100
commitf57caa1cbb452e5dc551fbbf4576fbdd1b6895fb (patch)
tree29da792d25059bdb8f49fab132f5e7be62e20e07
parentd9587198f13cc23d755640a883bc4161be21c886 (diff)
downloadrust-f57caa1cbb452e5dc551fbbf4576fbdd1b6895fb.tar.gz
rust-f57caa1cbb452e5dc551fbbf4576fbdd1b6895fb.zip
Bump proc-macro2 in xtask
-rw-r--r--src/tools/rust-analyzer/Cargo.lock4
-rw-r--r--src/tools/rust-analyzer/xtask/Cargo.toml3
-rw-r--r--src/tools/rust-analyzer/xtask/src/codegen/grammar.rs3
3 files changed, 6 insertions, 4 deletions
diff --git a/src/tools/rust-analyzer/Cargo.lock b/src/tools/rust-analyzer/Cargo.lock
index 3ba7df3ad51..bf408d1a52b 100644
--- a/src/tools/rust-analyzer/Cargo.lock
+++ b/src/tools/rust-analyzer/Cargo.lock
@@ -1408,9 +1408,9 @@ dependencies = [
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.86"
+version = "1.0.93"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
+checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
 dependencies = [
  "unicode-ident",
 ]
diff --git a/src/tools/rust-analyzer/xtask/Cargo.toml b/src/tools/rust-analyzer/xtask/Cargo.toml
index b505ee835b2..ebd8903ad8a 100644
--- a/src/tools/rust-analyzer/xtask/Cargo.toml
+++ b/src/tools/rust-analyzer/xtask/Cargo.toml
@@ -16,8 +16,7 @@ xflags = "0.3.0"
 time = { version = "0.3", default-features = false }
 zip = { version = "0.6", default-features = false, features = ["deflate", "time"] }
 stdx.workspace = true
-# https://github.com/dtolnay/proc-macro2/issues/475
-proc-macro2 = "=1.0.86"
+proc-macro2 = "1.0.93"
 quote = "1.0.20"
 ungrammar = "1.16.1"
 either.workspace = true
diff --git a/src/tools/rust-analyzer/xtask/src/codegen/grammar.rs b/src/tools/rust-analyzer/xtask/src/codegen/grammar.rs
index d5fe3236789..e20dda7fec3 100644
--- a/src/tools/rust-analyzer/xtask/src/codegen/grammar.rs
+++ b/src/tools/rust-analyzer/xtask/src/codegen/grammar.rs
@@ -397,6 +397,9 @@ fn generate_syntax_kinds(grammar: KindsSrc) -> String {
         if "{}[]()".contains(token) {
             let c = token.chars().next().unwrap();
             quote! { #c }
+            // underscore is an identifier in the proc-macro api
+        } else if *token == "_" {
+            quote! { _ }
         } else {
             let cs = token.chars().map(|c| Punct::new(c, Spacing::Joint));
             quote! { #(#cs)* }