File tree 3 files changed +12
-9
lines changed
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> {
100
100
101
101
/// The resolver behavior specified with the `resolver` field.
102
102
resolve_behavior : ResolveBehavior ,
103
+ honor_rust_version : Option < bool > ,
103
104
104
105
/// Workspace-level custom metadata
105
106
custom_metadata : Option < toml:: Value > ,
@@ -229,6 +230,7 @@ impl<'gctx> Workspace<'gctx> {
229
230
loaded_packages : RefCell :: new ( HashMap :: new ( ) ) ,
230
231
ignore_lock : false ,
231
232
resolve_behavior : ResolveBehavior :: V1 ,
233
+ honor_rust_version : None ,
232
234
custom_metadata : None ,
233
235
}
234
236
}
@@ -605,8 +607,12 @@ impl<'gctx> Workspace<'gctx> {
605
607
self . members ( ) . filter_map ( |pkg| pkg. rust_version ( ) ) . min ( )
606
608
}
607
609
610
+ pub fn set_honor_rust_version ( & mut self , honor_rust_version : Option < bool > ) {
611
+ self . honor_rust_version = honor_rust_version;
612
+ }
613
+
608
614
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 )
610
616
}
611
617
612
618
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 {
504
504
fn workspace < ' a > ( & self , gctx : & ' a GlobalContext ) -> CargoResult < Workspace < ' a > > {
505
505
let root = self . root_manifest ( gctx) ?;
506
506
let mut ws = Workspace :: new ( & root, gctx) ?;
507
+ ws. set_honor_rust_version ( self . honor_rust_version ( ) ) ;
507
508
if gctx. cli_unstable ( ) . avoid_dev_deps {
508
509
ws. set_require_optional_deps ( false ) ;
509
510
}
Original file line number Diff line number Diff line change @@ -347,15 +347,13 @@ fn dependency_rust_version_older_and_newer_than_package() {
347
347
p. cargo ( "check --ignore-rust-version" )
348
348
. arg ( "-Zmsrv-policy" )
349
349
. masquerade_as_nightly_cargo ( & [ "msrv-policy" ] )
350
- // This should pick 1.6.0
351
350
. with_stderr (
352
351
"\
353
352
[UPDATING] `dummy-registry` index
354
353
[LOCKING] 2 packages
355
- [ADDING] bar v1.5.0 (latest: v1.6.0)
356
354
[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
359
357
[CHECKING] [..]
360
358
[FINISHED] [..]
361
359
" ,
@@ -483,15 +481,13 @@ fn workspace_with_mixed_rust_version() {
483
481
p. cargo ( "check --ignore-rust-version" )
484
482
. arg ( "-Zmsrv-policy" )
485
483
. masquerade_as_nightly_cargo ( & [ "msrv-policy" ] )
486
- // This should pick 1.6.0
487
484
. with_stderr (
488
485
"\
489
486
[UPDATING] `dummy-registry` index
490
487
[LOCKING] 3 packages
491
- [ADDING] bar v1.4.0 (latest: v1.6.0)
492
488
[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
495
491
[CHECKING] [..]
496
492
[FINISHED] [..]
497
493
" ,
You can’t perform that action at this time.
0 commit comments