Skip to content

Commit

Permalink
Auto merge of #14459 - epage:msrv-rustc, r=Muscraft
Browse files Browse the repository at this point in the history
feat(resolve): Report incompatible-with-rustc when MSRV-resolver is disabled

### What does this PR try to resolve?

This builds on #14457 to report when deps are incompatible with rustc when an MSRV-aware resolver is not used.
This affects stable code.

### How should we test and review this PR?

### Additional information
  • Loading branch information
bors committed Aug 27, 2024
2 parents b8a4f1b + 3c19a8c commit 59ecb11
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/cargo/ops/cargo_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,9 @@ fn annotate_required_rust_version(
.map(|(dep, _)| (Some(required_rust_version.clone()), dep)),
);
}
} else {
for change in changes.values_mut() {
change.required_rust_version = rustc_version.clone();
}
}
}
8 changes: 6 additions & 2 deletions tests/testsuite/cargo_add/rustc_ignore/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions tests/testsuite/rust_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ fn lint_dep_incompatible_with_rust_version() {
.with_stderr_data(str![[r#"
[UPDATING] `dummy-registry` index
[LOCKING] 3 packages to latest compatible versions
[ADDING] too_new_child v0.0.1 (requires Rust 1.2345.0)
[ADDING] too_new_parent v0.0.1 (requires Rust 1.2345.0)
"#]])
.run();
Expand Down Expand Up @@ -296,6 +298,8 @@ fn resolve_with_rustc() {
.with_stderr_data(str![[r#"
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[ADDING] newer-and-older v1.6.0 (requires Rust 1.2345)
[ADDING] only-newer v1.6.0 (requires Rust 1.2345)
"#]])
.run();
Expand Down

0 comments on commit 59ecb11

Please sign in to comment.