@@ -62,7 +62,7 @@ use crate::util::profile;
62
62
63
63
use self :: context:: { Activations , Context } ;
64
64
use self :: dep_cache:: RegistryQueryer ;
65
- use self :: types:: { Candidate , ConflictMap , ConflictReason , DepsFrame } ;
65
+ use self :: types:: { ConflictMap , ConflictReason , DepsFrame } ;
66
66
use self :: types:: { FeaturesSet , RcVecIter , RemainingDeps , ResolverProgress } ;
67
67
68
68
pub use self :: encode:: { EncodableDependency , EncodablePackageId , EncodableResolve } ;
@@ -181,10 +181,7 @@ fn activate_deps_loop(
181
181
// Activate all the initial summaries to kick off some work.
182
182
for & ( ref summary, ref method) in summaries {
183
183
debug ! ( "initial activation: {}" , summary. package_id( ) ) ;
184
- let candidate = Candidate {
185
- summary : summary. clone ( ) ,
186
- } ;
187
- let res = activate ( & mut cx, registry, None , candidate, method. clone ( ) ) ;
184
+ let res = activate ( & mut cx, registry, None , summary. clone ( ) , method. clone ( ) ) ;
188
185
match res {
189
186
Ok ( Some ( ( frame, _) ) ) => remaining_deps. push ( frame) ,
190
187
Ok ( None ) => ( ) ,
@@ -369,7 +366,7 @@ fn activate_deps_loop(
369
366
None
370
367
} ;
371
368
372
- let pid = candidate. summary . package_id ( ) ;
369
+ let pid = candidate. package_id ( ) ;
373
370
let method = Method :: Required {
374
371
dev_deps : false ,
375
372
features : Rc :: clone ( & features) ,
@@ -381,7 +378,7 @@ fn activate_deps_loop(
381
378
parent. name( ) ,
382
379
cur,
383
380
dep. package_name( ) ,
384
- candidate. summary . version( )
381
+ candidate. version( )
385
382
) ;
386
383
let res = activate ( & mut cx, registry, Some ( ( & parent, & dep) ) , candidate, method) ;
387
384
@@ -594,10 +591,10 @@ fn activate(
594
591
cx : & mut Context ,
595
592
registry : & mut RegistryQueryer < ' _ > ,
596
593
parent : Option < ( & Summary , & Dependency ) > ,
597
- candidate : Candidate ,
594
+ candidate : Summary ,
598
595
method : Method ,
599
596
) -> ActivateResult < Option < ( DepsFrame , Duration ) > > {
600
- let candidate_pid = candidate. summary . package_id ( ) ;
597
+ let candidate_pid = candidate. package_id ( ) ;
601
598
if let Some ( ( parent, dep) ) = parent {
602
599
let parent_pid = parent. package_id ( ) ;
603
600
Rc :: make_mut (
@@ -656,7 +653,7 @@ fn activate(
656
653
}
657
654
}
658
655
659
- let activated = cx. flag_activated ( & candidate. summary , & method) ?;
656
+ let activated = cx. flag_activated ( & candidate, & method) ?;
660
657
661
658
let candidate = match registry. replacement_summary ( candidate_pid) {
662
659
Some ( replace) => {
@@ -675,7 +672,7 @@ fn activate(
675
672
return Ok ( None ) ;
676
673
}
677
674
trace ! ( "activating {}" , candidate_pid) ;
678
- candidate. summary
675
+ candidate
679
676
}
680
677
} ;
681
678
@@ -726,13 +723,13 @@ struct BacktrackFrame {
726
723
/// filtered out, and as they are filtered the causes will be added to `conflicting_prev_active`.
727
724
#[ derive( Clone ) ]
728
725
struct RemainingCandidates {
729
- remaining : RcVecIter < Candidate > ,
726
+ remaining : RcVecIter < Summary > ,
730
727
// This is a inlined peekable generator
731
- has_another : Option < Candidate > ,
728
+ has_another : Option < Summary > ,
732
729
}
733
730
734
731
impl RemainingCandidates {
735
- fn new ( candidates : & Rc < Vec < Candidate > > ) -> RemainingCandidates {
732
+ fn new ( candidates : & Rc < Vec < Summary > > ) -> RemainingCandidates {
736
733
RemainingCandidates {
737
734
remaining : RcVecIter :: new ( Rc :: clone ( candidates) ) ,
738
735
has_another : None ,
@@ -761,14 +758,14 @@ impl RemainingCandidates {
761
758
cx : & Context ,
762
759
dep : & Dependency ,
763
760
parent : PackageId ,
764
- ) -> Option < ( Candidate , bool ) > {
761
+ ) -> Option < ( Summary , bool ) > {
765
762
' main: for ( _, b) in self . remaining . by_ref ( ) {
766
- let b_id = b. summary . package_id ( ) ;
763
+ let b_id = b. package_id ( ) ;
767
764
// The `links` key in the manifest dictates that there's only one
768
765
// package in a dependency graph, globally, with that particular
769
766
// `links` key. If this candidate links to something that's already
770
767
// linked to by a different package then we've gotta skip this.
771
- if let Some ( link) = b. summary . links ( ) {
768
+ if let Some ( link) = b. links ( ) {
772
769
if let Some ( & a) = cx. links . get ( & link) {
773
770
if a != b_id {
774
771
conflicting_prev_active
@@ -788,7 +785,7 @@ impl RemainingCandidates {
788
785
// Here we throw out our candidate if it's *compatible*, yet not
789
786
// equal, to all previously activated versions.
790
787
if let Some ( ( a, _) ) = cx. activations . get ( & b_id. as_activations_key ( ) ) {
791
- if * a != b. summary {
788
+ if * a != b {
792
789
conflicting_prev_active
793
790
. entry ( a. package_id ( ) )
794
791
. or_insert ( ConflictReason :: Semver ) ;
@@ -904,7 +901,7 @@ fn generalize_conflicting(
904
901
. find (
905
902
dep,
906
903
& |id| {
907
- if id == other. summary . package_id ( ) {
904
+ if id == other. package_id ( ) {
908
905
// we are imagining that we used other instead
909
906
Some ( backtrack_critical_age)
910
907
} else {
@@ -913,9 +910,9 @@ fn generalize_conflicting(
913
910
age < backtrack_critical_age)
914
911
}
915
912
} ,
916
- Some ( other. summary . package_id ( ) ) ,
913
+ Some ( other. package_id ( ) ) ,
917
914
)
918
- . map ( |con| ( other. summary . package_id ( ) , con) )
915
+ . map ( |con| ( other. package_id ( ) , con) )
919
916
} )
920
917
. collect :: < Option < Vec < ( PackageId , & ConflictMap ) > > > ( )
921
918
{
@@ -972,7 +969,7 @@ fn find_candidate(
972
969
parent : & Summary ,
973
970
backtracked : bool ,
974
971
conflicting_activations : & ConflictMap ,
975
- ) -> Option < ( Candidate , bool , BacktrackFrame ) > {
972
+ ) -> Option < ( Summary , bool , BacktrackFrame ) > {
976
973
// When we're calling this method we know that `parent` failed to
977
974
// activate. That means that some dependency failed to get resolved for
978
975
// whatever reason. Normally, that means that all of those reasons
0 commit comments