Skip to content

Commit 0edbfbb

Browse files
committed
Auto merge of #6103 - Eh2406:proptest, r=alexcrichton
Proptest/Resolver move test helper functions to support This moves all the code in `tests/testsuite/resolve.rs` that is not tests of cargo to ` tests/testsuite/support/resolve.rs`. (follow up to #5921) This also clears up some inconsistencies in naming between local variables in `activate_deps_loop` and `BacktrackFrame`. (follow up to #6097) This is a true refactoring, nothing about the executable has changed.
2 parents 0253f4e + 6562123 commit 0edbfbb

File tree

5 files changed

+435
-418
lines changed

5 files changed

+435
-418
lines changed

src/cargo/core/resolver/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ fn activate_deps_loop(
300300
// Reset all of our local variables used with the
301301
// contents of `frame` to complete our backtrack.
302302
cur = frame.cur;
303-
cx = frame.context_backup;
304-
remaining_deps = frame.deps_backup;
303+
cx = frame.context;
304+
remaining_deps = frame.remaining_deps;
305305
remaining_candidates = frame.remaining_candidates;
306306
parent = frame.parent;
307307
dep = frame.dep;
@@ -345,8 +345,8 @@ fn activate_deps_loop(
345345
let backtrack = if has_another {
346346
Some(BacktrackFrame {
347347
cur,
348-
context_backup: Context::clone(&cx),
349-
deps_backup: remaining_deps.clone(),
348+
context: Context::clone(&cx),
349+
remaining_deps: remaining_deps.clone(),
350350
remaining_candidates: remaining_candidates.clone(),
351351
parent: Summary::clone(&parent),
352352
dep: Dependency::clone(&dep),
@@ -555,7 +555,7 @@ fn activate_deps_loop(
555555
// for error messages anyway so we can live with a little
556556
// imprecision.
557557
if let Some(b) = backtrack {
558-
cx = b.context_backup;
558+
cx = b.context;
559559
}
560560
}
561561

@@ -629,8 +629,8 @@ fn activate(
629629
#[derive(Clone)]
630630
struct BacktrackFrame {
631631
cur: usize,
632-
context_backup: Context,
633-
deps_backup: RemainingDeps,
632+
context: Context,
633+
remaining_deps: RemainingDeps,
634634
remaining_candidates: RemainingCandidates,
635635
parent: Summary,
636636
dep: Dependency,
@@ -780,7 +780,7 @@ fn find_candidate(
780780
while let Some(mut frame) = backtrack_stack.pop() {
781781
let next = frame.remaining_candidates.next(
782782
&mut frame.conflicting_activations,
783-
&frame.context_backup,
783+
&frame.context,
784784
&frame.dep,
785785
);
786786
let (candidate, has_another) = match next {
@@ -798,7 +798,7 @@ fn find_candidate(
798798
// completely skip this backtrack frame and move on to the next.
799799
if !backtracked {
800800
if frame
801-
.context_backup
801+
.context
802802
.is_conflicting(Some(parent.package_id()), conflicting_activations)
803803
{
804804
trace!(

src/cargo/core/resolver/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ impl ResolverProgress {
4747
config.shell().status("Resolving", "dependency graph...")?;
4848
}
4949
}
50-
// The largest test in our sweet takes less then 5000 ticks
50+
// The largest test in our suite takes less then 5000 ticks
5151
// with all the algorithm improvements.
5252
// If any of them are removed then it takes more than I am willing to measure.
5353
// So lets fail the test fast if we have ben running for two long.
5454
debug_assert!(self.ticks < 50_000);
55-
// The largest test in our sweet takes less then 30 sec
55+
// The largest test in our suite takes less then 30 sec
5656
// with all the improvements to how fast a tick can go.
5757
// If any of them are removed then it takes more than I am willing to measure.
5858
// So lets fail the test fast if we have ben running for two long.

0 commit comments

Comments
 (0)