diff --git a/Cargo.lock b/Cargo.lock index 0b47aae128338..17ad45623ed27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4348,8 +4348,7 @@ version = "0.0.0" dependencies = [ "expect-test", "memchr", - "unicode-ident", - "unicode-properties", + "rustc_unicode", ] [[package]] @@ -4380,10 +4379,10 @@ dependencies = [ "rustc_symbol_mangling", "rustc_target", "rustc_trait_selection", + "rustc_unicode", "smallvec", "thin-vec", "tracing", - "unicode-security", ] [[package]] @@ -4633,11 +4632,9 @@ dependencies = [ "rustc_macros", "rustc_session", "rustc_span", + "rustc_unicode", "thin-vec", "tracing", - "unicode-normalization", - "unicode-properties", - "unicode-width 0.2.2", ] [[package]] @@ -4870,11 +4867,11 @@ dependencies = [ "rustc_index", "rustc_macros", "rustc_serialize", + "rustc_unicode", "scoped-tls", "sha1", "sha2", "tracing", - "unicode-width 0.2.2", ] [[package]] @@ -5077,6 +5074,18 @@ dependencies = [ "synstructure", ] +[[package]] +name = "rustc_unicode" +version = "0.0.0" +dependencies = [ + "unicode-ident", + "unicode-normalization", + "unicode-properties", + "unicode-script", + "unicode-security", + "unicode-width 0.2.2", +] + [[package]] name = "rustc_version" version = "0.4.1" @@ -6230,9 +6239,9 @@ checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" [[package]] name = "unicode-script" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb421b350c9aff471779e262955939f565ec18b86c15364e6bdf0d662ca7c1f" +checksum = "383ad40bb927465ec0ce7720e033cb4ca06912855fc35db31b5755d0de75b1ee" [[package]] name = "unicode-security" diff --git a/compiler/rustc_lexer/Cargo.toml b/compiler/rustc_lexer/Cargo.toml index 057dce5b2f8d5..1abba4c4d0200 100644 --- a/compiler/rustc_lexer/Cargo.toml +++ b/compiler/rustc_lexer/Cargo.toml @@ -12,11 +12,10 @@ Rust lexer used by rustc. No stability guarantees are provided. # This will be used when publishing this crate as `rustc-ap-rustc_lexer`. [lib] -# Note that this crate purposefully does not depend on other rustc crates +# Note that this crate purposefully does not depend on other rustc crates other than `rustc-unicode` [dependencies] memchr = "2.7.6" -unicode-properties = { version = "0.1.4", default-features = false, features = ["emoji"] } -unicode-ident = "1.0.22" +rustc_unicode = { path = "../rustc_unicode" } [dev-dependencies] expect-test = "1.4.0" diff --git a/compiler/rustc_lexer/src/lib.rs b/compiler/rustc_lexer/src/lib.rs index 0aa57e75889fa..1ba476362b030 100644 --- a/compiler/rustc_lexer/src/lib.rs +++ b/compiler/rustc_lexer/src/lib.rs @@ -32,26 +32,9 @@ use std::str::Chars; use LiteralKind::*; use TokenKind::*; -pub use unicode_ident::UNICODE_VERSION; +use rustc_unicode::{unicode_ident, unicode_properties}; use unicode_properties::UnicodeEmoji; -// Make sure that the Unicode version of the dependencies is the same. -const _: () = { - let properties = unicode_properties::UNICODE_VERSION; - let ident = unicode_ident::UNICODE_VERSION; - - if properties.0 != ident.0 as u64 - || properties.1 != ident.1 as u64 - || properties.2 != ident.2 as u64 - { - panic!( - "unicode-properties and unicode-ident must use the same Unicode version, \ - `unicode_properties::UNICODE_VERSION` and `unicode_ident::UNICODE_VERSION` are \ - different." - ); - } -}; - /// Parsed token. /// It doesn't contain information about data that has been parsed, /// only the type of the token and its size. diff --git a/compiler/rustc_lint/Cargo.toml b/compiler/rustc_lint/Cargo.toml index 43417348f1d4b..418694fb58ca5 100644 --- a/compiler/rustc_lint/Cargo.toml +++ b/compiler/rustc_lint/Cargo.toml @@ -29,8 +29,8 @@ rustc_structures = { path = "../rustc_structures" } rustc_symbol_mangling = { path = "../rustc_symbol_mangling" } rustc_target = { path = "../rustc_target" } rustc_trait_selection = { path = "../rustc_trait_selection" } +rustc_unicode = { path = "../rustc_unicode" } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } thin-vec = "0.2.19" tracing = "0.1" -unicode-security = "0.1.0" # tidy-alphabetical-end diff --git a/compiler/rustc_lint/src/non_ascii_idents.rs b/compiler/rustc_lint/src/non_ascii_idents.rs index 588a9e1130f76..07680041dd6a0 100644 --- a/compiler/rustc_lint/src/non_ascii_idents.rs +++ b/compiler/rustc_lint/src/non_ascii_idents.rs @@ -3,6 +3,7 @@ use rustc_data_structures::fx::FxIndexMap; use rustc_data_structures::unord::UnordMap; use rustc_lint_defs::{declare_lint, declare_lint_pass}; use rustc_span::{OrdSpan, Symbol}; +use rustc_unicode::unicode_security; use unicode_security::general_security_profile::IdentifierType; use crate::diagnostics::{ diff --git a/compiler/rustc_parse/Cargo.toml b/compiler/rustc_parse/Cargo.toml index b54438384a215..84a79b542a6c3 100644 --- a/compiler/rustc_parse/Cargo.toml +++ b/compiler/rustc_parse/Cargo.toml @@ -18,11 +18,9 @@ rustc_lint_defs = { path = "../rustc_lint_defs" } rustc_macros = { path = "../rustc_macros" } rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } +rustc_unicode = { path = "../rustc_unicode" } thin-vec = "0.2.21" tracing = "0.1" -unicode-normalization = "0.1.25" -unicode-properties = { version = "0.1.4", default-features = false, features = ["emoji"] } -unicode-width = "0.2.2" # tidy-alphabetical-end [dev-dependencies] diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index 13bda08fe8096..32c1071af617a 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -16,8 +16,8 @@ use rustc_literal_escaper::{EscapeError, Mode, check_for_errors}; use rustc_session::parse::ParseSess; use rustc_span::edition::Edition; use rustc_span::{BytePos, Pos, Span, Symbol, sym}; +use rustc_unicode::unicode_properties::emoji::UnicodeEmoji; use tracing::debug; -use unicode_properties::emoji::UnicodeEmoji; use crate::lexer::diagnostics::TokenTreeDiagInfo; use crate::lexer::unicode_chars::UNICODE_ARRAY; @@ -1301,7 +1301,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> { } pub fn nfc_normalize(string: &str) -> Symbol { - use unicode_normalization::{IsNormalized, UnicodeNormalization, is_nfc_quick}; + use rustc_unicode::unicode_normalization::{IsNormalized, UnicodeNormalization, is_nfc_quick}; match is_nfc_quick(string.chars()) { IsNormalized::Yes => Symbol::intern(string), _ => { diff --git a/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs b/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs index f01caf8d9efed..c83f847f77195 100644 --- a/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs +++ b/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs @@ -6,6 +6,7 @@ use std::ops::Range; use rustc_errors::{Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed}; use rustc_literal_escaper::{EscapeError, Mode}; use rustc_span::{BytePos, Span}; +use rustc_unicode::{unicode_normalization, unicode_width}; use tracing::debug; use crate::diagnostics::{ diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs index 2c79db50a73ef..0ce5575e9cb9f 100644 --- a/compiler/rustc_parse/src/lib.rs +++ b/compiler/rustc_parse/src/lib.rs @@ -18,7 +18,6 @@ use rustc_ast::token; use rustc_ast::tokenstream::{DelimSpacing, DelimSpan, Spacing, TokenStream, TokenTree}; use rustc_ast_pretty::pprust; use rustc_errors::{Diag, FatalError, PResult, pluralize}; -pub use rustc_lexer::UNICODE_VERSION; use rustc_session::parse::ParseSess; use rustc_span::edit_distance::find_best_match_for_name; use rustc_span::source_map::SourceMap; @@ -36,44 +35,6 @@ pub mod lexer; mod diagnostics; -// Make sure that the Unicode version of the dependencies is the same. -const _: () = { - let rustc_lexer = rustc_lexer::UNICODE_VERSION; - let rustc_span = rustc_span::UNICODE_VERSION; - let normalization = unicode_normalization::UNICODE_VERSION; - let width = unicode_width::UNICODE_VERSION; - - if rustc_lexer.0 != rustc_span.0 - || rustc_lexer.1 != rustc_span.1 - || rustc_lexer.2 != rustc_span.2 - { - panic!( - "rustc_lexer and rustc_span must use the same Unicode version, \ - `rustc_lexer::UNICODE_VERSION` and `rustc_span::UNICODE_VERSION` are \ - different." - ); - } - - if rustc_lexer.0 != normalization.0 - || rustc_lexer.1 != normalization.1 - || rustc_lexer.2 != normalization.2 - { - panic!( - "rustc_lexer and unicode-normalization must use the same Unicode version, \ - `rustc_lexer::UNICODE_VERSION` and `unicode_normalization::UNICODE_VERSION` are \ - different." - ); - } - - if rustc_lexer.0 != width.0 || rustc_lexer.1 != width.1 || rustc_lexer.2 != width.2 { - panic!( - "rustc_lexer and unicode-width must use the same Unicode version, \ - `rustc_lexer::UNICODE_VERSION` and `unicode_width::UNICODE_VERSION` are \ - different." - ); - } -}; - // Unwrap the result if `Ok`, otherwise emit the diagnostics and abort. pub fn unwrap_or_emit_fatal(expr: Result>>) -> T { match expr { diff --git a/compiler/rustc_span/Cargo.toml b/compiler/rustc_span/Cargo.toml index f8e5e2b48b5f0..9a0f59bfb8fa9 100644 --- a/compiler/rustc_span/Cargo.toml +++ b/compiler/rustc_span/Cargo.toml @@ -16,9 +16,9 @@ rustc_hashes = { path = "../rustc_hashes" } rustc_index = { path = "../rustc_index" } rustc_macros = { path = "../rustc_macros" } rustc_serialize = { path = "../rustc_serialize" } +rustc_unicode = { path = "../rustc_unicode" } scoped-tls = "1.0" sha1 = "0.10.0" sha2 = "0.10.1" tracing = "0.1" -unicode-width = "0.2.2" # tidy-alphabetical-end diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 44fbbbaccd66f..de10cf4f12c2b 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -40,7 +40,6 @@ use rustc_serialize::opaque::mem_encoder::MemEncoder; use rustc_serialize::opaque::{FileEncoder, MemDecoder}; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use tracing::debug; -pub use unicode_width::UNICODE_VERSION; mod caching_source_map_view; pub mod source_map; @@ -90,6 +89,7 @@ use rustc_data_structures::stable_hash::{StableHash, StableHasher}; use rustc_data_structures::sync::{FreezeLock, FreezeWriteGuard, Lock}; use rustc_data_structures::unord::UnordMap; use rustc_hashes::{Hash64, Hash128}; +use rustc_unicode::unicode_width; use sha1::Sha1; use sha2::Sha256; use span_encoding::InlineCtxt; diff --git a/compiler/rustc_unicode/Cargo.toml b/compiler/rustc_unicode/Cargo.toml new file mode 100644 index 0000000000000..8f3a92c1c9145 --- /dev/null +++ b/compiler/rustc_unicode/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "rustc_unicode" +version = "0.0.0" +edition = "2024" + +[dependencies] +# tidy-alphabetical-start +unicode-ident = "=1.0.24" +unicode-normalization = "=0.1.25" +unicode-properties = { version = "=0.1.4", default-features = false, features = ["emoji"] } +unicode-script = "=0.5.8" +unicode-security = "=0.1.2" +unicode-width = "=0.2.2" +# tidy-alphabetical-end diff --git a/compiler/rustc_unicode/src/lib.rs b/compiler/rustc_unicode/src/lib.rs new file mode 100644 index 0000000000000..0ea1caf00352a --- /dev/null +++ b/compiler/rustc_unicode/src/lib.rs @@ -0,0 +1,38 @@ +//! Unified crate for re-exporting Unicode crates for the compiler. +//! Used to avoid having multiple different Unicode versions in use. + +// If this changes, update https://github.com/rust-lang/reference/blob/HEAD/src/identifiers.md. +const UNICODE_VERSION: (u8, u8, u8) = (17, 0, 0); + +macro_rules! reexport_and_check { + ($($krate:ident),+ $(,)?) => { + $( + pub use $krate; + const _: () = { + let (major, minor, patch) = crate::UNICODE_VERSION; + let (major_, minor_, patch_) = $krate::UNICODE_VERSION; + if major != major_ as u8 || minor != minor_ as u8 || patch != patch_ as u8 { + panic!( + concat!( + stringify!($krate), + " does not have the correct Unicode version (`rustc-unicode::UNICODE_VERSION`)" + ) + ) + } + }; + )+ + } +} + +reexport_and_check!( + // tidy-alphabetical-start + unicode_ident, + unicode_normalization, + unicode_properties, + // FIXME: Update to version supporting Unicode 17 + // unicode_security, + unicode_script, + unicode_width, + // tidy-alphabetical-end +); +pub use unicode_security; diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_bench.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_bench.snap index c609f5ffd51fa..deabc0ea19e49 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_bench.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_bench.snap @@ -98,6 +98,7 @@ expression: bench - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Bench] test::CrateRustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_build_compiler.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_build_compiler.snap index 41529a664a189..875b524611d3b 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_build_compiler.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_build_compiler.snap @@ -80,6 +80,7 @@ expression: build compiler - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Build] compile::Assemble targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check.snap index 8f9abbf0e3f5a..9cca2c97407c0 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check.snap @@ -82,6 +82,7 @@ expression: check - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Check] check::Rustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiler.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiler.snap index efedf514001c2..d71e6541c176b 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiler.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiler.snap @@ -82,4 +82,5 @@ expression: check compiler - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiletest_include_default_paths.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiletest_include_default_paths.snap index 526aa31cc74af..f9cb5379a6dc5 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiletest_include_default_paths.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_check_compiletest_include_default_paths.snap @@ -82,6 +82,7 @@ expression: check compiletest --include-default-paths - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Check] check::Rustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_clippy.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_clippy.snap index 17b69d85ff821..f011be62827de 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_clippy.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_clippy.snap @@ -97,4 +97,5 @@ expression: clippy - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_fix.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_fix.snap index 01f0ef3f05d67..27f90c0c244c0 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_fix.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_fix.snap @@ -82,6 +82,7 @@ expression: fix - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Fix] check::Rustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap index 0967b604412e6..0a802af041800 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap @@ -149,6 +149,7 @@ expression: test - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Test] test::CrateRustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap index cd835904b00d1..7ff506e34958a 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap @@ -146,6 +146,7 @@ expression: test --skip=coverage - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Test] test::CrateRustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_map.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_map.snap index 0801bdf09328f..79f01afb87b9b 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_map.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_map.snap @@ -149,6 +149,7 @@ expression: test --skip=coverage-map - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Test] test::CrateRustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_run.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_run.snap index d7ec4e55cc710..4f5dfb020430f 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_run.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage_run.snap @@ -149,6 +149,7 @@ expression: test --skip=coverage-run - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Test] test::CrateRustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap index bee21f9fd3b91..66026df92941e 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap @@ -107,6 +107,7 @@ expression: test --skip=tests - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Test] test::CrateRustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_coverage.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_coverage.snap index afa6039d5cba2..ed52681f2e4a9 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_coverage.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_coverage.snap @@ -146,6 +146,7 @@ expression: test --skip=tests/coverage - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Test] test::CrateRustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_etc.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_etc.snap index 20c8ec8b25a9a..d2934781377f7 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_etc.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests_etc.snap @@ -91,6 +91,7 @@ expression: test --skip=tests --skip=library --skip=tidyselftest - Set({compiler/rustc_ty_walk}) - Set({compiler/rustc_type_ir}) - Set({compiler/rustc_type_ir_macros}) + - Set({compiler/rustc_unicode}) - Set({compiler/rustc_windows_rc}) [Test] test::CrateRustdoc targets: [x86_64-unknown-linux-gnu] diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 544c47602136a..a909cc6255376 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -1492,7 +1492,7 @@ mod snapshot { #[test] fn check_compiler_no_explicit_stage() { let ctx = TestCtx::new(); - expect_test::expect![["[check] rustc 0 -> rustc 1 (78 crates)"]] + expect_test::expect!["[check] rustc 0 -> rustc 1 (79 crates)"] .assert_eq(&ctx.config("check").path("compiler").render_steps()); } @@ -1513,7 +1513,7 @@ mod snapshot { #[test] fn check_compiler_stage_1() { let ctx = TestCtx::new(); - expect_test::expect![["[check] rustc 0 -> rustc 1 (78 crates)"]] + expect_test::expect!["[check] rustc 0 -> rustc 1 (79 crates)"] .assert_eq(&ctx.config("check").path("compiler").stage(1).render_steps()); } @@ -1524,7 +1524,7 @@ mod snapshot { [build] llvm [build] rustc 0 -> rustc 1 [build] rustc 1 -> std 1 - [check] rustc 1 -> rustc 2 (78 crates)"#]] + [check] rustc 1 -> rustc 2 (79 crates)"#]] .assert_eq(&ctx.config("check").path("compiler").stage(2).render_steps()); } @@ -1536,7 +1536,7 @@ mod snapshot { [build] rustc 0 -> rustc 1 [build] rustc 1 -> std 1 [check] rustc 1 -> std 1 - [check] rustc 1 -> rustc 2 (78 crates) + [check] rustc 1 -> rustc 2 (79 crates) [check] rustc 1 -> rustc 2 [check] rustc 1 -> Rustdoc 2 [check] rustc 1 -> rustc_codegen_cranelift 2 @@ -1617,7 +1617,7 @@ mod snapshot { expect_test::expect![[""]] .assert_eq(&ctx.config("check").paths(&["library"]).args(&args).render_steps()); - expect_test::expect![["[check] rustc 0 -> rustc 1 (78 crates)"]].assert_eq( + expect_test::expect!["[check] rustc 0 -> rustc 1 (79 crates)"].assert_eq( &ctx.config("check").paths(&["library", "compiler"]).args(&args).render_steps(), ); } @@ -2750,7 +2750,7 @@ mod snapshot { #[test] fn fix_compiler() { let ctx = TestCtx::new(); - expect_test::expect![["[fix] rustc 0 -> rustc 1 (78 crates)"]] + expect_test::expect!["[fix] rustc 0 -> rustc 1 (79 crates)"] .assert_eq(&ctx.config("fix").path("compiler").render_steps()); } } diff --git a/tests/ui-fulldeps/lexer/unicode-version.rs b/tests/ui-fulldeps/lexer/unicode-version.rs deleted file mode 100644 index a924f9241649a..0000000000000 --- a/tests/ui-fulldeps/lexer/unicode-version.rs +++ /dev/null @@ -1,25 +0,0 @@ -// This test is used to validate which version of Unicode is used for parsing -// identifiers. If the Unicode version changes, it should also be updated in -// the reference at -// https://github.com/rust-lang/reference/blob/HEAD/src/identifiers.md. - -//@ run-pass -//@ check-run-results -//@ ignore-cross-compile -//@ reference: ident.unicode -//@ reference: ident.normalization - -#![feature(rustc_private)] - -extern crate rustc_driver; -extern crate rustc_parse; - -fn main() { - println!("Checking if Unicode version changed."); - println!( - "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." - ); - println!("Unicode version used in rustc_parse is: {:?}", rustc_parse::UNICODE_VERSION); -} diff --git a/tests/ui-fulldeps/lexer/unicode-version.run.stdout b/tests/ui-fulldeps/lexer/unicode-version.run.stdout deleted file mode 100644 index 327b089970343..0000000000000 --- a/tests/ui-fulldeps/lexer/unicode-version.run.stdout +++ /dev/null @@ -1,3 +0,0 @@ -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) diff --git a/triagebot.toml b/triagebot.toml index 35891af78fbdb..e2e494d199caf 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -1500,13 +1500,6 @@ cc = ["@Zalathar"] [mentions."src/tools/opt-dist"] cc = ["@kobzol"] -[mentions."tests/ui-fulldeps/lexer/unicode-version.run.stdout"] -message = """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. -""" -cc = ["@rust-lang/lang-docs"] - [mentions."src/doc/rustc-dev-guide"] message = "The rustc-dev-guide subtree was changed. If your future PRs *only* touch the subtree, consider submitting them directly to [rust-lang/rustc-dev-guide](https://github.com/rust-lang/rustc-dev-guide/pulls), which is where the document is primarily maintained (and has faster CI)." cc = ["@BoxyUwU", "@tshepang"]