mirror of https://github.com/rust-lang/cargo
refactor(resolve): Abstract out MSRV policy tracking
This commit is contained in:
parent
789eda2b83
commit
11448b44fe
|
@ -605,6 +605,10 @@ impl<'gctx> Workspace<'gctx> {
|
|||
self.members().filter_map(|pkg| pkg.rust_version()).min()
|
||||
}
|
||||
|
||||
pub fn resolve_honors_rust_version(&self) -> bool {
|
||||
self.gctx().cli_unstable().msrv_policy
|
||||
}
|
||||
|
||||
pub fn custom_metadata(&self) -> Option<&toml::Value> {
|
||||
self.custom_metadata.as_ref()
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ pub fn resolve_with_previous<'gctx>(
|
|||
if ws.gctx().cli_unstable().minimal_versions {
|
||||
version_prefs.version_ordering(VersionOrdering::MinimumVersionsFirst)
|
||||
}
|
||||
if ws.gctx().cli_unstable().msrv_policy {
|
||||
if ws.resolve_honors_rust_version() {
|
||||
version_prefs.max_rust_version(ws.rust_version().cloned().map(RustVersion::into_partial));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue