mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
fix(resolver): Prefer rust-version over schema version
This commit is contained in:
parent
06b5ec5765
commit
0ed5c215a2
@ -362,12 +362,23 @@ pub(super) fn activation_error(
|
||||
let _ = writeln!(&mut msg, " version {} is not cached", summary.version());
|
||||
}
|
||||
IndexSummary::Unsupported(summary, schema_version) => {
|
||||
let _ = writeln!(
|
||||
if let Some(rust_version) = summary.rust_version() {
|
||||
// HACK: technically its unsupported and we shouldn't make assumptions
|
||||
// about the entry but this is limited and for diagnostics purposes
|
||||
let _ = writeln!(
|
||||
&mut msg,
|
||||
" version {} requires cargo {}",
|
||||
summary.version(),
|
||||
rust_version
|
||||
);
|
||||
} else {
|
||||
let _ = writeln!(
|
||||
&mut msg,
|
||||
" version {} requires a Cargo version that supports index version {}",
|
||||
summary.version(),
|
||||
schema_version
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3267,7 +3267,7 @@ fn unknown_index_version_with_msrv_error() {
|
||||
.with_stderr_data(str![[r#"
|
||||
[UPDATING] `dummy-registry` index
|
||||
[ERROR] no matching versions for `bar` found
|
||||
version 1.0.1 requires a Cargo version that supports index version 4294967295
|
||||
version 1.0.1 requires cargo 1.2345
|
||||
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
|
||||
required by package `foo v0.1.0 ([ROOT]/foo)`
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user