@@ -11,6 +11,7 @@ use serde::Serialize;
11
11
use url:: Url ;
12
12
13
13
use crate :: core:: interning:: InternedString ;
14
+ use crate :: core:: resolver:: ResolveBehavior ;
14
15
use crate :: core:: { Dependency , PackageId , PackageIdSpec , SourceId , Summary } ;
15
16
use crate :: core:: { Edition , Feature , Features , WorkspaceConfig } ;
16
17
use crate :: util:: errors:: * ;
@@ -45,6 +46,7 @@ pub struct Manifest {
45
46
im_a_teapot : Option < bool > ,
46
47
default_run : Option < String > ,
47
48
metabuild : Option < Vec < String > > ,
49
+ resolve_behavior : Option < ResolveBehavior > ,
48
50
}
49
51
50
52
/// When parsing `Cargo.toml`, some warnings should silenced
@@ -67,6 +69,7 @@ pub struct VirtualManifest {
67
69
profiles : Option < TomlProfiles > ,
68
70
warnings : Warnings ,
69
71
features : Features ,
72
+ resolve_behavior : Option < ResolveBehavior > ,
70
73
}
71
74
72
75
/// General metadata about a package which is just blindly uploaded to the
@@ -421,6 +424,7 @@ impl Manifest {
421
424
default_run : Option < String > ,
422
425
original : Rc < TomlManifest > ,
423
426
metabuild : Option < Vec < String > > ,
427
+ resolve_behavior : Option < ResolveBehavior > ,
424
428
) -> Manifest {
425
429
Manifest {
426
430
summary,
@@ -443,6 +447,7 @@ impl Manifest {
443
447
default_run,
444
448
publish_lockfile,
445
449
metabuild,
450
+ resolve_behavior,
446
451
}
447
452
}
448
453
@@ -509,6 +514,13 @@ impl Manifest {
509
514
& self . features
510
515
}
511
516
517
+ /// The style of resolver behavior to use, declared with the `resolver` field.
518
+ ///
519
+ /// Returns `None` if it is not specified.
520
+ pub fn resolve_behavior ( & self ) -> Option < ResolveBehavior > {
521
+ self . resolve_behavior
522
+ }
523
+
512
524
pub fn map_source ( self , to_replace : SourceId , replace_with : SourceId ) -> Manifest {
513
525
Manifest {
514
526
summary : self . summary . map_source ( to_replace, replace_with) ,
@@ -572,6 +584,7 @@ impl VirtualManifest {
572
584
workspace : WorkspaceConfig ,
573
585
profiles : Option < TomlProfiles > ,
574
586
features : Features ,
587
+ resolve_behavior : Option < ResolveBehavior > ,
575
588
) -> VirtualManifest {
576
589
VirtualManifest {
577
590
replace,
@@ -580,6 +593,7 @@ impl VirtualManifest {
580
593
profiles,
581
594
warnings : Warnings :: new ( ) ,
582
595
features,
596
+ resolve_behavior,
583
597
}
584
598
}
585
599
@@ -610,6 +624,13 @@ impl VirtualManifest {
610
624
pub fn features ( & self ) -> & Features {
611
625
& self . features
612
626
}
627
+
628
+ /// The style of resolver behavior to use, declared with the `resolver` field.
629
+ ///
630
+ /// Returns `None` if it is not specified.
631
+ pub fn resolve_behavior ( & self ) -> Option < ResolveBehavior > {
632
+ self . resolve_behavior
633
+ }
613
634
}
614
635
615
636
impl Target {
0 commit comments