Skip to content

Commit

Permalink
feat(resolve): Report incompatible with rustc when MSRV-resolve disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 26, 2024
1 parent b8a4f1b commit 3c19a8c
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 3c19a8c

Please sign in to comment.