@@ -958,13 +958,14 @@ fn find_candidate(
958
958
} else {
959
959
None
960
960
} ;
961
+ let mut new_frame = None ;
962
+ if let Some ( age) = age {
963
+ while let Some ( frame) = backtrack_stack. pop ( ) {
964
+ // If all members of `conflicting_activations` are still
965
+ // active in this back up we know that we're guaranteed to not actually
966
+ // make any progress. As a result if we hit this condition we can
967
+ // completely skip this backtrack frame and move on to the next.
961
968
962
- while let Some ( mut frame) = backtrack_stack. pop ( ) {
963
- // If all members of `conflicting_activations` are still
964
- // active in this back up we know that we're guaranteed to not actually
965
- // make any progress. As a result if we hit this condition we can
966
- // completely skip this backtrack frame and move on to the next.
967
- if let Some ( age) = age {
968
969
// Above we use `cx` to determine if this is going to be conflicting.
969
970
// But lets just double check if the `pop`ed frame agrees.
970
971
let frame_too_new = frame. context . age >= age;
@@ -975,26 +976,30 @@ fn find_candidate(
975
976
== frame_too_new. then_some( age)
976
977
) ;
977
978
978
- if frame_to_new {
979
- trace ! (
980
- "{} = \" {}\" skip as not solving {}: {:?}" ,
981
- frame. dep. package_name( ) ,
982
- frame. dep. version_req( ) ,
983
- parent. package_id( ) ,
984
- conflicting_activations
985
- ) ;
986
- continue ;
979
+ if !frame_too_new {
980
+ new_frame = Some ( frame) ;
981
+ break ;
987
982
}
983
+ trace ! (
984
+ "{} = \" {}\" skip as not solving {}: {:?}" ,
985
+ frame. dep. package_name( ) ,
986
+ frame. dep. version_req( ) ,
987
+ parent. package_id( ) ,
988
+ conflicting_activations
989
+ ) ;
988
990
}
991
+ } else {
992
+ // If we're here then we are in abnormal situations and need to just go one frame at a time.
993
+ new_frame = backtrack_stack. pop ( ) ;
994
+ }
989
995
996
+ new_frame. map ( |mut frame| {
990
997
let ( candidate, has_another) = frame
991
998
. remaining_candidates
992
999
. next ( & mut frame. conflicting_activations , & frame. context )
993
1000
. expect ( "why did we save a frame that has no next?" ) ;
994
-
995
- return Some ( ( candidate, has_another, frame) ) ;
996
- }
997
- None
1001
+ ( candidate, has_another, frame)
1002
+ } )
998
1003
}
999
1004
1000
1005
fn check_cycles ( resolve : & Resolve ) -> CargoResult < ( ) > {
0 commit comments