From 336cdde791fa4a8c86935dd87a8e4f39fcbeff59 Mon Sep 17 00:00:00 2001 From: Jamie Hill-Daniel Date: Sun, 1 Nov 2026 19:01:29 +0000 Subject: [PATCH 1/2] Update to Unicode 18 --- Cargo.lock | 44 +++++++++---------- compiler/rustc_lexer/Cargo.toml | 2 +- src/bootstrap/Cargo.lock | 4 +- src/ci/citool/Cargo.lock | 4 +- .../ui/literal_string_with_formatting_arg.rs | 2 +- src/tools/rustbook/Cargo.lock | 8 ++-- .../item-name-grapheme-cluster-wbr.rs | 2 +- .../lexer/unicode-version.run.stdout | 2 +- tests/ui/codemap_tests/unicode_2.rs | 1 + tests/ui/codemap_tests/unicode_2.stderr | 11 ++++- .../concat-unicode-expansion.rs | 5 ++- .../concat-unicode-expansion.stderr | 35 +++++++++++++++ 12 files changed, 84 insertions(+), 36 deletions(-) create mode 100644 tests/ui/macros/metavar-expressions/concat-unicode-expansion.stderr diff --git a/Cargo.lock b/Cargo.lock index feeba051664e2..4661525ec27fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -59,7 +59,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "710e8eae58854cdc1790fcb56cca04d712a17be849eeb81da2a724bf4bae2bc4" dependencies = [ "anstyle", - "unicode-width 0.2.2", + "unicode-width 0.2.3", ] [[package]] @@ -70,7 +70,7 @@ checksum = "f211a51805bc641f3ad5b7664c77d2547af685cc33b4cd8d31964027a46f13f1" dependencies = [ "anstyle", "memchr", - "unicode-width 0.2.2", + "unicode-width 0.2.3", ] [[package]] @@ -155,7 +155,7 @@ dependencies = [ "anstyle-lossy", "anstyle-parse 0.2.7", "html-escape", - "unicode-width 0.2.2", + "unicode-width 0.2.3", ] [[package]] @@ -768,7 +768,7 @@ checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681" dependencies = [ "serde", "termcolor", - "unicode-width 0.2.2", + "unicode-width 0.2.3", ] [[package]] @@ -887,7 +887,7 @@ checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" dependencies = [ "encode_unicode", "libc", - "unicode-width 0.2.2", + "unicode-width 0.2.3", "windows-sys", ] @@ -1583,7 +1583,7 @@ version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe4fbac503b8d1f88e6676011885f34b7174f46e59956bba534ba83abded4df" dependencies = [ - "unicode-width 0.2.2", + "unicode-width 0.2.3", ] [[package]] @@ -1990,7 +1990,7 @@ checksum = "25470f23803092da7d239834776d653104d551bc4d7eacaf31e6837854b8e9eb" dependencies = [ "console", "portable-atomic", - "unicode-width 0.2.2", + "unicode-width 0.2.3", "unit-prefix", "web-time", ] @@ -4636,7 +4636,7 @@ dependencies = [ "tracing", "unicode-normalization", "unicode-properties", - "unicode-width 0.2.2", + "unicode-width 0.2.3", ] [[package]] @@ -4873,7 +4873,7 @@ dependencies = [ "sha1", "sha2", "tracing", - "unicode-width 0.2.2", + "unicode-width 0.2.3", ] [[package]] @@ -6208,36 +6208,36 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "unicode-normalization" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +checksum = "75cd3fb03d5288b3ba9a1ee103ac7e9cbb59f0b03d64f8ddfcc04dd42758a85d" dependencies = [ "tinyvec", ] [[package]] name = "unicode-properties" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" +checksum = "993ad287eb20e8ba755312801cfe1413e0f25d604075863acaddca10b04c1833" [[package]] name = "unicode-script" -version = "0.5.7" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb421b350c9aff471779e262955939f565ec18b86c15364e6bdf0d662ca7c1f" +checksum = "aa04c955db05429d464c74d495c1ee677e1866e783a4c3747f9c0cef7756cabf" [[package]] name = "unicode-security" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e4ddba1535dd35ed8b61c52166b7155d7f4e4b8847cec6f48e71dc66d8b5e50" +checksum = "4a23f3d0a5f302dbfdc8c5303c943c325e67cb478611bf1f44fb4c1520c64eb7" dependencies = [ "unicode-normalization", "unicode-script", @@ -6265,9 +6265,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" +checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557" [[package]] name = "unicode-xid" @@ -6547,7 +6547,7 @@ dependencies = [ "bumpalo", "leb128fmt", "memchr", - "unicode-width 0.2.2", + "unicode-width 0.2.3", "wasm-encoder 0.257.1", ] diff --git a/compiler/rustc_lexer/Cargo.toml b/compiler/rustc_lexer/Cargo.toml index 057dce5b2f8d5..da1d5bd0f4073 100644 --- a/compiler/rustc_lexer/Cargo.toml +++ b/compiler/rustc_lexer/Cargo.toml @@ -16,7 +16,7 @@ Rust lexer used by rustc. No stability guarantees are provided. [dependencies] memchr = "2.7.6" unicode-properties = { version = "0.1.4", default-features = false, features = ["emoji"] } -unicode-ident = "1.0.22" +unicode-ident = "1.0.24" [dev-dependencies] expect-test = "1.4.0" diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock index 4d72f562a0bc6..d8a59235de273 100644 --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock @@ -831,9 +831,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "valuable" diff --git a/src/ci/citool/Cargo.lock b/src/ci/citool/Cargo.lock index 9d891739c1556..1c8c6fee46893 100644 --- a/src/ci/citool/Cargo.lock +++ b/src/ci/citool/Cargo.lock @@ -1084,9 +1084,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "unsafe-libyaml" diff --git a/src/tools/clippy/tests/ui/literal_string_with_formatting_arg.rs b/src/tools/clippy/tests/ui/literal_string_with_formatting_arg.rs index 21dc51f322584..6388de540bd89 100644 --- a/src/tools/clippy/tests/ui/literal_string_with_formatting_arg.rs +++ b/src/tools/clippy/tests/ui/literal_string_with_formatting_arg.rs @@ -1,5 +1,5 @@ #![warn(clippy::literal_string_with_formatting_args)] -#![expect(clippy::unnecessary_literal_unwrap)] +#![expect(clippy::unnecessary_literal_unwrap, mixed_script_confusables)] // Regression test for . // It's not supposed to emit the lint in this case (in `assert!` expansion). diff --git a/src/tools/rustbook/Cargo.lock b/src/tools/rustbook/Cargo.lock index 24d7c6cb9e428..15d37291ae572 100644 --- a/src/tools/rustbook/Cargo.lock +++ b/src/tools/rustbook/Cargo.lock @@ -1742,15 +1742,15 @@ checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" [[package]] name = "unicode-ident" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "unicode-width" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" +checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557" [[package]] name = "unicode-xid" diff --git a/tests/rustdoc-html/item-name-grapheme-cluster-wbr.rs b/tests/rustdoc-html/item-name-grapheme-cluster-wbr.rs index 5244f970389ca..872ca3a0d68d5 100644 --- a/tests/rustdoc-html/item-name-grapheme-cluster-wbr.rs +++ b/tests/rustdoc-html/item-name-grapheme-cluster-wbr.rs @@ -2,7 +2,7 @@ // grapheme cluster starts with a `Prepend` character and contains `_`. #![crate_name = "foo"] -#![allow(mixed_script_confusables, non_camel_case_types)] +#![allow(mixed_script_confusables, non_camel_case_types, uncommon_codepoints)] //@ hasraw foo/index.html 'abcൎ_defgh' pub struct abcൎ_defgh; diff --git a/tests/ui-fulldeps/lexer/unicode-version.run.stdout b/tests/ui-fulldeps/lexer/unicode-version.run.stdout index 327b089970343..232b1ac21afe8 100644 --- a/tests/ui-fulldeps/lexer/unicode-version.run.stdout +++ b/tests/ui-fulldeps/lexer/unicode-version.run.stdout @@ -1,3 +1,3 @@ Checking if Unicode version changed. If the Unicode version changes are intentional, it should also be updated in the reference at https://github.com/rust-lang/reference/blob/HEAD/src/identifiers.md. -Unicode version used in rustc_parse is: (17, 0, 0) +Unicode version used in rustc_parse is: (18, 0, 0) diff --git a/tests/ui/codemap_tests/unicode_2.rs b/tests/ui/codemap_tests/unicode_2.rs index 3301e7a18d11a..38f28500cca69 100644 --- a/tests/ui/codemap_tests/unicode_2.rs +++ b/tests/ui/codemap_tests/unicode_2.rs @@ -2,4 +2,5 @@ fn main() { let _ = ("a̐éö̲", 0u7); //~ ERROR invalid width let _ = ("아あ", 1i42); //~ ERROR invalid width let _ = a̐é; //~ ERROR cannot find + //~^ WARN identifier contains a character that is for non-linguistic, specialized usage } diff --git a/tests/ui/codemap_tests/unicode_2.stderr b/tests/ui/codemap_tests/unicode_2.stderr index 19aae1d3c9511..1b94842ebeed8 100644 --- a/tests/ui/codemap_tests/unicode_2.stderr +++ b/tests/ui/codemap_tests/unicode_2.stderr @@ -4,6 +4,15 @@ error[E0425]: cannot find value `a̐é` in this scope LL | let _ = a̐é; | ^^ not found in this scope +warning: identifier contains a character that is for non-linguistic, specialized usage: '\u{310}' + --> $DIR/unicode_2.rs:4:13 + | +LL | let _ = a̐é; + | ^^ + | + = note: this character is included in the Technical Unicode general security profile + = note: `#[warn(uncommon_codepoints)]` on by default + error: invalid width `7` for integer literal --> $DIR/unicode_2.rs:2:25 | @@ -20,6 +29,6 @@ LL | let _ = ("아あ", 1i42); | = help: valid widths are 8, 16, 32, 64 and 128 -error: aborting due to 3 previous errors +error: aborting due to 3 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/macros/metavar-expressions/concat-unicode-expansion.rs b/tests/ui/macros/metavar-expressions/concat-unicode-expansion.rs index 4eeb2384deb78..d7e8da69dd181 100644 --- a/tests/ui/macros/metavar-expressions/concat-unicode-expansion.rs +++ b/tests/ui/macros/metavar-expressions/concat-unicode-expansion.rs @@ -12,8 +12,11 @@ macro_rules! turn_to_page { fn main() { turn_to_page!(P1, "Ṕ2", Ṕ); + //~^ WARN: identifier contains an uncommon character: 'Ṕ' assert_eq!(ḦṔ, 394); + //~^ WARN: identifier contains uncommon characters: 'Ḧ' and 'Ṕ' assert_eq!(ḦP1, 394); + //~^ WARN: identifier contains an uncommon character: 'Ḧ' assert_eq!(ḦṔ2, 394); - + //~^ WARN: identifier contains uncommon characters: 'Ḧ' and 'Ṕ' } diff --git a/tests/ui/macros/metavar-expressions/concat-unicode-expansion.stderr b/tests/ui/macros/metavar-expressions/concat-unicode-expansion.stderr new file mode 100644 index 0000000000000..d9d772c71e2c4 --- /dev/null +++ b/tests/ui/macros/metavar-expressions/concat-unicode-expansion.stderr @@ -0,0 +1,35 @@ +warning: identifier contains an uncommon character: 'Ṕ' + --> $DIR/concat-unicode-expansion.rs:14:29 + | +LL | turn_to_page!(P1, "Ṕ2", Ṕ); + | ^ + | + = note: this character is included in the Unicode general security profile + = note: `#[warn(uncommon_codepoints)]` on by default + +warning: identifier contains uncommon characters: 'Ḧ' and 'Ṕ' + --> $DIR/concat-unicode-expansion.rs:16:16 + | +LL | assert_eq!(ḦṔ, 394); + | ^^ + | + = note: these characters are included in the Unicode general security profile + +warning: identifier contains an uncommon character: 'Ḧ' + --> $DIR/concat-unicode-expansion.rs:18:16 + | +LL | assert_eq!(ḦP1, 394); + | ^^^ + | + = note: this character is included in the Unicode general security profile + +warning: identifier contains uncommon characters: 'Ḧ' and 'Ṕ' + --> $DIR/concat-unicode-expansion.rs:20:16 + | +LL | assert_eq!(ḦṔ2, 394); + | ^^^ + | + = note: these characters are included in the Unicode general security profile + +warning: 4 warnings emitted + From 1ff43d76cd2e6772232ee847ff6d806490a7f572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=C3=B3n=20Orell=20Valerian=20Liehr?= Date: Mon, 16 Nov 2026 22:18:43 +0100 Subject: [PATCH 2/2] Update compiler/rustc_lexer/Cargo.toml --- compiler/rustc_lexer/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_lexer/Cargo.toml b/compiler/rustc_lexer/Cargo.toml index da1d5bd0f4073..e16667ac5f63f 100644 --- a/compiler/rustc_lexer/Cargo.toml +++ b/compiler/rustc_lexer/Cargo.toml @@ -16,7 +16,7 @@ Rust lexer used by rustc. No stability guarantees are provided. [dependencies] memchr = "2.7.6" unicode-properties = { version = "0.1.4", default-features = false, features = ["emoji"] } -unicode-ident = "1.0.24" +unicode-ident = "1.0.27" [dev-dependencies] expect-test = "1.4.0"