[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251124151837.2184382-9-ojeda@kernel.org>
Date: Mon, 24 Nov 2025 16:18:20 +0100
From: Miguel Ojeda <ojeda@...nel.org>
To: Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Nathan Chancellor <nathan@...nel.org>,
Nicolas Schier <nicolas@...sle.eu>
Cc: Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
rust-for-linux@...r.kernel.org,
linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org,
patches@...ts.linux.dev,
Jesung Yang <y.j3ms.n@...il.com>
Subject: [PATCH v2 08/20] rust: proc-macro2: remove `unicode_ident` dependency
The `proc-macro2` crate depends on the `unicode-ident` crate to determine
whether characters have the XID_Start or XID_Continue properties according
to Unicode Standard Annex #31.
However, we only need ASCII identifiers in the kernel, thus we can
simplify the check and remove completely that dependency.
Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
Reviewed-by: Gary Guo <gary@...yguo.net>
Tested-by: Gary Guo <gary@...yguo.net>
Tested-by: Jesung Yang <y.j3ms.n@...il.com>
Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
---
rust/proc-macro2/fallback.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/proc-macro2/fallback.rs b/rust/proc-macro2/fallback.rs
index 9e005d67f7f5..9b43c97df97a 100644
--- a/rust/proc-macro2/fallback.rs
+++ b/rust/proc-macro2/fallback.rs
@@ -818,11 +818,11 @@ pub(crate) fn set_span(&mut self, span: Span) {
}
pub(crate) fn is_ident_start(c: char) -> bool {
- c == '_' || unicode_ident::is_xid_start(c)
+ c == '_' || c.is_ascii_alphabetic()
}
pub(crate) fn is_ident_continue(c: char) -> bool {
- unicode_ident::is_xid_continue(c)
+ c == '_' || c.is_ascii_alphanumeric()
}
#[track_caller]
--
2.52.0
Powered by blists - more mailing lists