Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cargo #118275

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tools/cargo
Submodule cargo updated 58 files
+6 −4 Cargo.lock
+1 −1 Cargo.toml
+27 −0 crates/cargo-test-support/src/registry.rs
+33 −0 crates/rustfix/Cargo.toml
+79 −0 crates/rustfix/Changelog.md
+1 −0 crates/rustfix/LICENSE-APACHE
+1 −0 crates/rustfix/LICENSE-MIT
+29 −0 crates/rustfix/Readme.md
+44 −0 crates/rustfix/examples/fix-json.rs
+8 −0 crates/rustfix/proptest-regressions/replace.txt
+89 −0 crates/rustfix/src/diagnostics.rs
+272 −0 crates/rustfix/src/lib.rs
+335 −0 crates/rustfix/src/replace.rs
+42 −0 crates/rustfix/tests/edge-cases/empty.json
+0 −0 crates/rustfix/tests/edge-cases/empty.rs
+60 −0 crates/rustfix/tests/edge-cases/indented_whitespace.json
+33 −0 crates/rustfix/tests/edge-cases/no_main.json
+1 −0 crates/rustfix/tests/edge-cases/no_main.rs
+43 −0 crates/rustfix/tests/edge-cases/out_of_bounds.recorded.json
+59 −0 crates/rustfix/tests/edge-cases/utf8_idents.recorded.json
+25 −0 crates/rustfix/tests/edge_cases.rs
+2 −0 crates/rustfix/tests/edition/.gitignore
+2 −0 crates/rustfix/tests/everything/.gitignore
+10 −0 crates/rustfix/tests/everything/E0178.fixed.rs
+70 −0 crates/rustfix/tests/everything/E0178.json
+10 −0 crates/rustfix/tests/everything/E0178.rs
+10 −0 crates/rustfix/tests/everything/closure-immutable-outer-variable.fixed.rs
+70 −0 crates/rustfix/tests/everything/closure-immutable-outer-variable.json
+10 −0 crates/rustfix/tests/everything/closure-immutable-outer-variable.rs
+8 −0 crates/rustfix/tests/everything/handle-insert-only.fixed.rs
+68 −0 crates/rustfix/tests/everything/handle-insert-only.json
+8 −0 crates/rustfix/tests/everything/handle-insert-only.rs
+7 −0 crates/rustfix/tests/everything/lt-generic-comp.fixed.rs
+87 −0 crates/rustfix/tests/everything/lt-generic-comp.json
+7 −0 crates/rustfix/tests/everything/lt-generic-comp.rs
+5 −0 crates/rustfix/tests/everything/multiple-solutions.fixed.rs
+114 −0 crates/rustfix/tests/everything/multiple-solutions.json
+5 −0 crates/rustfix/tests/everything/multiple-solutions.rs
+3 −0 crates/rustfix/tests/everything/replace-only-one-char.fixed.rs
+70 −0 crates/rustfix/tests/everything/replace-only-one-char.json
+3 −0 crates/rustfix/tests/everything/replace-only-one-char.rs
+5 −0 crates/rustfix/tests/everything/str-lit-type-mismatch.fixed.rs
+218 −0 crates/rustfix/tests/everything/str-lit-type-mismatch.json
+5 −0 crates/rustfix/tests/everything/str-lit-type-mismatch.rs
+246 −0 crates/rustfix/tests/parse_and_replace.rs
+1 −0 crates/xtask-bump-check/src/xtask.rs
+1 −0 publish.py
+1 −1 src/cargo/core/compiler/job_queue/mod.rs
+19 −8 src/cargo/core/compiler/mod.rs
+43 −0 src/cargo/ops/cargo_package.rs
+6 −7 src/cargo/util/toml/mod.rs
+3 −5 src/doc/contrib/src/issues.md
+1 −0 src/doc/src/reference/environment-variables.md
+205 −7 tests/testsuite/build.rs
+2 −2 tests/testsuite/cargo_remove/update_lock_file/in/Cargo.lock
+2 −2 tests/testsuite/cargo_remove/update_lock_file/out/Cargo.lock
+49 −0 tests/testsuite/package.rs
+1 −0 triagebot.toml
40 changes: 0 additions & 40 deletions src/tools/tidy/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,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() {
Expand All @@ -512,15 +511,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,
);
}
}

Expand Down Expand Up @@ -749,33 +739,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
);
}
}
Loading