@@ -62,7 +62,7 @@ use crate::util::profile;
6262
6363use self :: context:: { Activations , Context } ;
6464use self :: dep_cache:: RegistryQueryer ;
65- use self :: types:: { Candidate , ConflictMap , ConflictReason , DepsFrame } ;
65+ use self :: types:: { ConflictMap , ConflictReason , DepsFrame } ;
6666use self :: types:: { FeaturesSet , RcVecIter , RemainingDeps , ResolverProgress } ;
6767
6868pub use self :: encode:: { EncodableDependency , EncodablePackageId , EncodableResolve } ;
@@ -181,11 +181,7 @@ fn activate_deps_loop(
181181 // Activate all the initial summaries to kick off some work.
182182 for & ( ref summary, ref method) in summaries {
183183 debug ! ( "initial activation: {}" , summary. package_id( ) ) ;
184- let candidate = Candidate {
185- summary : summary. clone ( ) ,
186- replace : None ,
187- } ;
188- let res = activate ( & mut cx, registry, None , candidate, method. clone ( ) ) ;
184+ let res = activate ( & mut cx, registry, None , summary. clone ( ) , method. clone ( ) ) ;
189185 match res {
190186 Ok ( Some ( ( frame, _) ) ) => remaining_deps. push ( frame) ,
191187 Ok ( None ) => ( ) ,
@@ -370,7 +366,7 @@ fn activate_deps_loop(
370366 None
371367 } ;
372368
373- let pid = candidate. summary . package_id ( ) ;
369+ let pid = candidate. package_id ( ) ;
374370 let method = Method :: Required {
375371 dev_deps : false ,
376372 features : Rc :: clone ( & features) ,
@@ -382,7 +378,7 @@ fn activate_deps_loop(
382378 parent. name( ) ,
383379 cur,
384380 dep. package_name( ) ,
385- candidate. summary . version( )
381+ candidate. version( )
386382 ) ;
387383 let res = activate ( & mut cx, registry, Some ( ( & parent, & dep) ) , candidate, method) ;
388384
@@ -595,10 +591,10 @@ fn activate(
595591 cx : & mut Context ,
596592 registry : & mut RegistryQueryer < ' _ > ,
597593 parent : Option < ( & Summary , & Dependency ) > ,
598- candidate : Candidate ,
594+ candidate : Summary ,
599595 method : Method ,
600596) -> ActivateResult < Option < ( DepsFrame , Duration ) > > {
601- let candidate_pid = candidate. summary . package_id ( ) ;
597+ let candidate_pid = candidate. package_id ( ) ;
602598 if let Some ( ( parent, dep) ) = parent {
603599 let parent_pid = parent. package_id ( ) ;
604600 Rc :: make_mut (
@@ -657,9 +653,9 @@ fn activate(
657653 }
658654 }
659655
660- let activated = cx. flag_activated ( & candidate. summary , & method) ?;
656+ let activated = cx. flag_activated ( & candidate, & method) ?;
661657
662- let candidate = match candidate . replace {
658+ let candidate = match registry . replacement_summary ( candidate_pid ) {
663659 Some ( replace) => {
664660 if cx. flag_activated ( & replace, & method) ? && activated {
665661 return Ok ( None ) ;
@@ -669,14 +665,14 @@ fn activate(
669665 replace. package_id( ) ,
670666 candidate_pid
671667 ) ;
672- replace
668+ replace. clone ( )
673669 }
674670 None => {
675671 if activated {
676672 return Ok ( None ) ;
677673 }
678674 trace ! ( "activating {}" , candidate_pid) ;
679- candidate. summary
675+ candidate
680676 }
681677 } ;
682678
@@ -727,13 +723,13 @@ struct BacktrackFrame {
727723/// filtered out, and as they are filtered the causes will be added to `conflicting_prev_active`.
728724#[ derive( Clone ) ]
729725struct RemainingCandidates {
730- remaining : RcVecIter < Candidate > ,
726+ remaining : RcVecIter < Summary > ,
731727 // This is a inlined peekable generator
732- has_another : Option < Candidate > ,
728+ has_another : Option < Summary > ,
733729}
734730
735731impl RemainingCandidates {
736- fn new ( candidates : & Rc < Vec < Candidate > > ) -> RemainingCandidates {
732+ fn new ( candidates : & Rc < Vec < Summary > > ) -> RemainingCandidates {
737733 RemainingCandidates {
738734 remaining : RcVecIter :: new ( Rc :: clone ( candidates) ) ,
739735 has_another : None ,
@@ -762,14 +758,14 @@ impl RemainingCandidates {
762758 cx : & Context ,
763759 dep : & Dependency ,
764760 parent : PackageId ,
765- ) -> Option < ( Candidate , bool ) > {
761+ ) -> Option < ( Summary , bool ) > {
766762 ' main: for ( _, b) in self . remaining . by_ref ( ) {
767- let b_id = b. summary . package_id ( ) ;
763+ let b_id = b. package_id ( ) ;
768764 // The `links` key in the manifest dictates that there's only one
769765 // package in a dependency graph, globally, with that particular
770766 // `links` key. If this candidate links to something that's already
771767 // linked to by a different package then we've gotta skip this.
772- if let Some ( link) = b. summary . links ( ) {
768+ if let Some ( link) = b. links ( ) {
773769 if let Some ( & a) = cx. links . get ( & link) {
774770 if a != b_id {
775771 conflicting_prev_active
@@ -789,7 +785,7 @@ impl RemainingCandidates {
789785 // Here we throw out our candidate if it's *compatible*, yet not
790786 // equal, to all previously activated versions.
791787 if let Some ( ( a, _) ) = cx. activations . get ( & b_id. as_activations_key ( ) ) {
792- if * a != b. summary {
788+ if * a != b {
793789 conflicting_prev_active
794790 . entry ( a. package_id ( ) )
795791 . or_insert ( ConflictReason :: Semver ) ;
@@ -905,7 +901,7 @@ fn generalize_conflicting(
905901 . find (
906902 dep,
907903 & |id| {
908- if id == other. summary . package_id ( ) {
904+ if id == other. package_id ( ) {
909905 // we are imagining that we used other instead
910906 Some ( backtrack_critical_age)
911907 } else {
@@ -914,9 +910,9 @@ fn generalize_conflicting(
914910 age < backtrack_critical_age)
915911 }
916912 } ,
917- Some ( other. summary . package_id ( ) ) ,
913+ Some ( other. package_id ( ) ) ,
918914 )
919- . map ( |con| ( other. summary . package_id ( ) , con) )
915+ . map ( |con| ( other. package_id ( ) , con) )
920916 } )
921917 . collect :: < Option < Vec < ( PackageId , & ConflictMap ) > > > ( )
922918 {
@@ -973,7 +969,7 @@ fn find_candidate(
973969 parent : & Summary ,
974970 backtracked : bool ,
975971 conflicting_activations : & ConflictMap ,
976- ) -> Option < ( Candidate , bool , BacktrackFrame ) > {
972+ ) -> Option < ( Summary , bool , BacktrackFrame ) > {
977973 // When we're calling this method we know that `parent` failed to
978974 // activate. That means that some dependency failed to get resolved for
979975 // whatever reason. Normally, that means that all of those reasons
0 commit comments