Skip to content

Commit 91b5a9d

Browse files
committed
consistently refer to backtracking instead of jump back, backjump, or jumpback
1 parent 1dd8e56 commit 91b5a9d

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

src/cargo/core/resolver/context.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ pub struct Context {
5656
/// When backtracking it can be useful to know how far back to go.
5757
/// The `ContextAge` of a `Context` is a monotonically increasing counter of the number
5858
/// of decisions made to get to this state.
59-
/// Several structures store the `ContextAge` when it was added, that gets use in jump back.
59+
/// Several structures store the `ContextAge` when it was added,
60+
/// to be used in `find_candidate` for backtracking.
6061
pub type ContextAge = usize;
6162

6263
/// Find the activated version of a crate based on the name, source, and semver compatibility.

src/cargo/core/resolver/mod.rs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ impl RemainingCandidates {
855855
}
856856
}
857857

858-
/// Attempts to find a new conflict that allows a bigger backjump then the input one.
858+
/// Attempts to find a new conflict that allows a `find_candidate` feather then the input one.
859859
/// It will add the new conflict to the cache if one is found.
860860
///
861861
/// Panics if the input conflict is not all active in `cx`.
@@ -871,28 +871,28 @@ fn generalize_conflicting(
871871
return None;
872872
}
873873
// We need to determine the `ContextAge` that this `conflicting_activations` will jump to, and why.
874-
let (jumpback_critical_age, jumpback_critical_id) = conflicting_activations
874+
let (backtrack_critical_age, backtrack_critical_id) = conflicting_activations
875875
.keys()
876876
.map(|&c| (cx.is_active(c).expect("not currently active!?"), c))
877877
.max()
878878
.unwrap();
879-
let jumpback_critical_reason: ConflictReason =
880-
conflicting_activations[&jumpback_critical_id].clone();
879+
let backtrack_critical_reason: ConflictReason =
880+
conflicting_activations[&backtrack_critical_id].clone();
881881

882882
if cx
883883
.parents
884-
.is_path_from_to(&parent.package_id(), &jumpback_critical_id)
884+
.is_path_from_to(&parent.package_id(), &backtrack_critical_id)
885885
{
886886
// We are a descendant of the trigger of the problem.
887887
// The best generalization of this is to let things bubble up
888-
// and let `jumpback_critical_id` figure this out.
888+
// and let `backtrack_critical_id` figure this out.
889889
return None;
890890
}
891891
// What parents does that critical activation have
892892
for (critical_parent, critical_parents_deps) in
893-
cx.parents.edges(&jumpback_critical_id).filter(|(p, _)| {
893+
cx.parents.edges(&backtrack_critical_id).filter(|(p, _)| {
894894
// it will only help backjump further if it is older then the critical_age
895-
cx.is_active(*p).expect("parent not currently active!?") < jumpback_critical_age
895+
cx.is_active(*p).expect("parent not currently active!?") < backtrack_critical_age
896896
})
897897
{
898898
for critical_parents_dep in critical_parents_deps.iter() {
@@ -906,14 +906,17 @@ fn generalize_conflicting(
906906
.rev() // the last one to be tried is the least likely to be in the cache, so start with that.
907907
.all(|other| {
908908
let mut con = conflicting_activations.clone();
909-
con.remove(&jumpback_critical_id);
910-
con.insert(other.summary.package_id(), jumpback_critical_reason.clone());
909+
con.remove(&backtrack_critical_id);
910+
con.insert(
911+
other.summary.package_id(),
912+
backtrack_critical_reason.clone(),
913+
);
911914
past_conflicting_activations.contains(&dep, &con)
912915
})
913916
{
914917
let mut con = conflicting_activations.clone();
915-
con.remove(&jumpback_critical_id);
916-
con.insert(*critical_parent, jumpback_critical_reason);
918+
con.remove(&backtrack_critical_id);
919+
con.insert(*critical_parent, backtrack_critical_reason);
917920
past_conflicting_activations.insert(&dep, &con);
918921
return Some(con);
919922
}

src/cargo/core/resolver/types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,9 @@ pub enum ConflictReason {
403403
/// candidate we're activating didn't actually have the feature `foo`.
404404
MissingFeatures(String),
405405

406-
// TODO: needs more info for errors maneges
407-
// TODO: needs more info for back jumping
408-
/// pub dep errore
406+
// TODO: needs more info for `activation_error`
407+
// TODO: needs more info for `find_candidate`
408+
/// pub dep error
409409
PublicDependency,
410410
}
411411

0 commit comments

Comments
 (0)