From: Miguel Ojeda Date: Mon, 24 Nov 2025 15:18:20 +0000 (+0100) Subject: rust: proc-macro2: remove `unicode_ident` dependency X-Git-Tag: v6.19-rc1~175^2^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2af0e5f02b9aebfc53987c6e935d266101f0ce9;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Gary Guo Tested-by: Gary Guo Tested-by: Jesung Yang Link: https://patch.msgid.link/20251124151837.2184382-9-ojeda@kernel.org Signed-off-by: Miguel Ojeda --- diff --git a/rust/proc-macro2/fallback.rs b/rust/proc-macro2/fallback.rs index 9e005d67f7f55..9b43c97df97a1 100644 --- a/rust/proc-macro2/fallback.rs +++ b/rust/proc-macro2/fallback.rs @@ -818,11 +818,11 @@ impl Ident { } 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]