Skip to content

Commit f5dc265

Browse files
committed
Auto merge of #118275 - weihanglo:update-cargo, r=ehuss
Update cargo 7 commits in 71cd3a926f0cf41eeaf9f2a7f2194b2aff85b0f6..9b13310ca596020a737aaa47daa4ed9ff8898a2f 2023-11-20 15:30:57 +0000 to 2023-11-24 16:20:51 +0000 - feat: Add `CARGO_RUSTC_CURRENT_DIR` (unstable) (rust-lang/cargo#12996) - Exited with hard error when custom build file no existence or not in package (rust-lang/cargo#12995) - try running on windows (rust-lang/cargo#13042) - refactor(toml): Better abstract inheritance details (rust-lang/cargo#13021) - cargo-test-support: Add features to the default Cargo.toml file (rust-lang/cargo#12997) - Migrate rustfix to the cargo repo (rust-lang/cargo#13005) - typo: rusc -> rustc (rust-lang/cargo#13019) --- This also removes the check to ensure that `rustfix` between * src/tools/cargo * src/tools/compiletest has the same version, since `rust-lang/rustfix` has migrated to under `rust-lang/cargo`. r? ghost
2 parents ec1393f + 9b013bb commit f5dc265

File tree

2 files changed

+1
-41
lines changed

2 files changed

+1
-41
lines changed

src/tools/cargo

Submodule cargo updated 58 files

src/tools/tidy/src/deps.rs

-40
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,6 @@ const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[
488488
/// to the cargo executable.
489489
pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
490490
let mut checked_runtime_licenses = false;
491-
let mut rust_metadata = None;
492491

493492
for &(workspace, exceptions, permitted_deps) in WORKSPACES {
494493
if !root.join(workspace).join("Cargo.lock").exists() {
@@ -512,15 +511,6 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
512511
let runtime_ids = compute_runtime_crates(&metadata);
513512
check_runtime_license_exceptions(&metadata, runtime_ids, bad);
514513
checked_runtime_licenses = true;
515-
rust_metadata = Some(metadata);
516-
} else if workspace == "src/tools/cargo" {
517-
check_rustfix(
518-
rust_metadata
519-
.as_ref()
520-
.expect("The root workspace should be the first to be checked"),
521-
&metadata,
522-
bad,
523-
);
524514
}
525515
}
526516

@@ -749,33 +739,3 @@ fn deps_of_filtered<'a>(
749739
deps_of_filtered(metadata, &dep.pkg, result, filter);
750740
}
751741
}
752-
753-
fn direct_deps_of<'a>(
754-
metadata: &'a Metadata,
755-
pkg_id: &'a PackageId,
756-
) -> impl Iterator<Item = &'a Package> {
757-
let resolve = metadata.resolve.as_ref().unwrap();
758-
let node = resolve.nodes.iter().find(|n| &n.id == pkg_id).unwrap();
759-
node.deps.iter().map(|dep| pkg_from_id(metadata, &dep.pkg))
760-
}
761-
762-
fn check_rustfix(rust_metadata: &Metadata, cargo_metadata: &Metadata, bad: &mut bool) {
763-
let cargo = pkg_from_name(cargo_metadata, "cargo");
764-
let cargo_rustfix =
765-
direct_deps_of(cargo_metadata, &cargo.id).find(|p| p.name == "rustfix").unwrap();
766-
767-
let compiletest = pkg_from_name(rust_metadata, "compiletest");
768-
let compiletest_rustfix =
769-
direct_deps_of(rust_metadata, &compiletest.id).find(|p| p.name == "rustfix").unwrap();
770-
771-
if cargo_rustfix.version != compiletest_rustfix.version {
772-
tidy_error!(
773-
bad,
774-
"cargo's rustfix version {} does not match compiletest's rustfix version {}\n\
775-
rustfix should be kept in sync, update the cargo side first, and then update \
776-
compiletest along with cargo.",
777-
cargo_rustfix.version,
778-
compiletest_rustfix.version
779-
);
780-
}
781-
}

0 commit comments

Comments
 (0)