File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ pub struct Workspace<'gctx> {
100100
101101 /// The resolver behavior specified with the `resolver` field.
102102 resolve_behavior : ResolveBehavior ,
103+ honor_rust_version : Option < bool > ,
103104
104105 /// Workspace-level custom metadata
105106 custom_metadata : Option < toml:: Value > ,
@@ -229,6 +230,7 @@ impl<'gctx> Workspace<'gctx> {
229230 loaded_packages : RefCell :: new ( HashMap :: new ( ) ) ,
230231 ignore_lock : false ,
231232 resolve_behavior : ResolveBehavior :: V1 ,
233+ honor_rust_version : None ,
232234 custom_metadata : None ,
233235 }
234236 }
@@ -605,8 +607,12 @@ impl<'gctx> Workspace<'gctx> {
605607 self . members ( ) . filter_map ( |pkg| pkg. rust_version ( ) ) . min ( )
606608 }
607609
610+ pub fn set_honor_rust_version ( & mut self , honor_rust_version : Option < bool > ) {
611+ self . honor_rust_version = honor_rust_version;
612+ }
613+
608614 pub fn resolve_honors_rust_version ( & self ) -> bool {
609- self . gctx ( ) . cli_unstable ( ) . msrv_policy
615+ self . gctx ( ) . cli_unstable ( ) . msrv_policy && self . honor_rust_version . unwrap_or ( true )
610616 }
611617
612618 pub fn custom_metadata ( & self ) -> Option < & toml:: Value > {
Original file line number Diff line number Diff line change @@ -504,6 +504,7 @@ pub trait ArgMatchesExt {
504504 fn workspace < ' a > ( & self , gctx : & ' a GlobalContext ) -> CargoResult < Workspace < ' a > > {
505505 let root = self . root_manifest ( gctx) ?;
506506 let mut ws = Workspace :: new ( & root, gctx) ?;
507+ ws. set_honor_rust_version ( self . honor_rust_version ( ) ) ;
507508 if gctx. cli_unstable ( ) . avoid_dev_deps {
508509 ws. set_require_optional_deps ( false ) ;
509510 }
Original file line number Diff line number Diff line change @@ -347,15 +347,13 @@ fn dependency_rust_version_older_and_newer_than_package() {
347347 p. cargo ( "check --ignore-rust-version" )
348348 . arg ( "-Zmsrv-policy" )
349349 . masquerade_as_nightly_cargo ( & [ "msrv-policy" ] )
350- // This should pick 1.6.0
351350 . with_stderr (
352351 "\
353352 [UPDATING] `dummy-registry` index
354353[LOCKING] 2 packages
355- [ADDING] bar v1.5.0 (latest: v1.6.0)
356354[DOWNLOADING] crates ...
357- [DOWNLOADED] bar v1.5 .0 (registry `dummy-registry`)
358- [CHECKING] bar v1.5 .0
355+ [DOWNLOADED] bar v1.6 .0 (registry `dummy-registry`)
356+ [CHECKING] bar v1.6 .0
359357[CHECKING] [..]
360358[FINISHED] [..]
361359" ,
@@ -483,15 +481,13 @@ fn workspace_with_mixed_rust_version() {
483481 p. cargo ( "check --ignore-rust-version" )
484482 . arg ( "-Zmsrv-policy" )
485483 . masquerade_as_nightly_cargo ( & [ "msrv-policy" ] )
486- // This should pick 1.6.0
487484 . with_stderr (
488485 "\
489486 [UPDATING] `dummy-registry` index
490487[LOCKING] 3 packages
491- [ADDING] bar v1.4.0 (latest: v1.6.0)
492488[DOWNLOADING] crates ...
493- [DOWNLOADED] bar v1.4 .0 (registry `dummy-registry`)
494- [CHECKING] bar v1.4 .0
489+ [DOWNLOADED] bar v1.6 .0 (registry `dummy-registry`)
490+ [CHECKING] bar v1.6 .0
495491[CHECKING] [..]
496492[FINISHED] [..]
497493" ,
You can’t perform that action at this time.
0 commit comments