Skip to content

Commit 11448b4

Browse files
committed
refactor(resolve): Abstract out MSRV policy tracking
1 parent 789eda2 commit 11448b4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/cargo/core/workspace.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ impl<'gctx> Workspace<'gctx> {
605605
self.members().filter_map(|pkg| pkg.rust_version()).min()
606606
}
607607

608+
pub fn resolve_honors_rust_version(&self) -> bool {
609+
self.gctx().cli_unstable().msrv_policy
610+
}
611+
608612
pub fn custom_metadata(&self) -> Option<&toml::Value> {
609613
self.custom_metadata.as_ref()
610614
}

src/cargo/ops/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ pub fn resolve_with_previous<'gctx>(
323323
if ws.gctx().cli_unstable().minimal_versions {
324324
version_prefs.version_ordering(VersionOrdering::MinimumVersionsFirst)
325325
}
326-
if ws.gctx().cli_unstable().msrv_policy {
326+
if ws.resolve_honors_rust_version() {
327327
version_prefs.max_rust_version(ws.rust_version().cloned().map(RustVersion::into_partial));
328328
}
329329

0 commit comments

Comments
 (0)