diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:25:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:25:56 +0000 |
commit | 018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch) | |
tree | a835ebdf2088ef88fa681f8fad45f09922c1ae9a /src/tools/tidy | |
parent | Adding debian version 1.75.0+dfsg1-5. (diff) | |
download | rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/tidy')
-rw-r--r-- | src/tools/tidy/src/deps.rs | 49 | ||||
-rw-r--r-- | src/tools/tidy/src/main.rs | 1 | ||||
-rw-r--r-- | src/tools/tidy/src/ui_tests.rs | 2 |
3 files changed, 7 insertions, 45 deletions
diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index f88f91655..3c00027b9 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -16,6 +16,7 @@ const LICENSES: &[&str] = &[ "Apache-2.0 OR MIT", "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", // wasi license "Apache-2.0/MIT", + "BSD-2-Clause OR Apache-2.0 OR MIT", // zerocopy "ISC", "MIT / Apache-2.0", "MIT OR Apache-2.0 OR LGPL-2.1-or-later", // r-efi, r-efi-alloc @@ -128,9 +129,7 @@ const EXCEPTIONS_CARGO: ExceptionList = &[ const EXCEPTIONS_RUST_ANALYZER: ExceptionList = &[ // tidy-alphabetical-start - ("anymap", "BlueOak-1.0.0 OR MIT OR Apache-2.0"), // BlueOak is not acceptable, but we use it under MIT OR Apache-2 .0 ("dissimilar", "Apache-2.0"), - ("instant", "BSD-3-Clause"), ("notify", "CC0-1.0"), ("pulldown-cmark-to-cmark", "Apache-2.0"), ("ryu", "Apache-2.0 OR BSL-1.0"), // BSL is not acceptble, but we use it under Apache-2.0 @@ -212,7 +211,6 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "crossbeam-epoch", "crossbeam-utils", "crypto-common", - "cstr", "darling", "darling_core", "darling_macro", @@ -256,7 +254,6 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "icu_provider_macros", "ident_case", "indexmap", - "instant", "intl-memoizer", "intl_pluralrules", "is-terminal", @@ -360,6 +357,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "tracing-tree", "twox-hash", "type-map", + "typed-arena", "typenum", "unic-langid", "unic-langid-impl", @@ -373,6 +371,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "unicode-security", "unicode-width", "unicode-xid", + "unwinding", "valuable", "version_check", "wasi", @@ -394,6 +393,8 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "yansi-term", // this is a false-positive: it's only used by rustfmt, but because it's enabled through a feature, tidy thinks it's used by rustc as well. "yoke", "yoke-derive", + "zerocopy", + "zerocopy-derive", "zerofrom", "zerofrom-derive", "zerovec", @@ -489,7 +490,6 @@ const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[ /// to the cargo executable. pub fn check(root: &Path, cargo: &Path, bad: &mut bool) { let mut checked_runtime_licenses = false; - let mut rust_metadata = None; for &(workspace, exceptions, permitted_deps) in WORKSPACES { if !root.join(workspace).join("Cargo.lock").exists() { @@ -513,15 +513,6 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) { let runtime_ids = compute_runtime_crates(&metadata); check_runtime_license_exceptions(&metadata, runtime_ids, bad); checked_runtime_licenses = true; - rust_metadata = Some(metadata); - } else if workspace == "src/tools/cargo" { - check_rustfix( - rust_metadata - .as_ref() - .expect("The root workspace should be the first to be checked"), - &metadata, - bad, - ); } } @@ -750,33 +741,3 @@ fn deps_of_filtered<'a>( deps_of_filtered(metadata, &dep.pkg, result, filter); } } - -fn direct_deps_of<'a>( - metadata: &'a Metadata, - pkg_id: &'a PackageId, -) -> impl Iterator<Item = &'a Package> { - let resolve = metadata.resolve.as_ref().unwrap(); - let node = resolve.nodes.iter().find(|n| &n.id == pkg_id).unwrap(); - node.deps.iter().map(|dep| pkg_from_id(metadata, &dep.pkg)) -} - -fn check_rustfix(rust_metadata: &Metadata, cargo_metadata: &Metadata, bad: &mut bool) { - let cargo = pkg_from_name(cargo_metadata, "cargo"); - let cargo_rustfix = - direct_deps_of(cargo_metadata, &cargo.id).find(|p| p.name == "rustfix").unwrap(); - - let compiletest = pkg_from_name(rust_metadata, "compiletest"); - let compiletest_rustfix = - direct_deps_of(rust_metadata, &compiletest.id).find(|p| p.name == "rustfix").unwrap(); - - if cargo_rustfix.version != compiletest_rustfix.version { - tidy_error!( - bad, - "cargo's rustfix version {} does not match compiletest's rustfix version {}\n\ - rustfix should be kept in sync, update the cargo side first, and then update \ - compiletest along with cargo.", - cargo_rustfix.version, - compiletest_rustfix.version - ); - } -} diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 80e58ba00..9f92b8995 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -132,6 +132,7 @@ fn main() { check!(edition, &library_path); check!(alphabetical, &src_path); + check!(alphabetical, &tests_path); check!(alphabetical, &compiler_path); check!(alphabetical, &library_path); diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 7e24793ad..dfa386b49 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -10,7 +10,7 @@ use std::path::{Path, PathBuf}; const ENTRY_LIMIT: usize = 900; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: usize = 1854; +const ISSUES_ENTRY_LIMIT: usize = 1852; const ROOT_ENTRY_LIMIT: usize = 867; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ |