Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proptest/Resolver move test helper functions to support #6103

Merged
merged 3 commits into from
Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/cargo/core/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ fn activate_deps_loop(
// Reset all of our local variables used with the
// contents of `frame` to complete our backtrack.
cur = frame.cur;
cx = frame.context_backup;
remaining_deps = frame.deps_backup;
cx = frame.context;
remaining_deps = frame.remaining_deps;
remaining_candidates = frame.remaining_candidates;
parent = frame.parent;
dep = frame.dep;
Expand Down Expand Up @@ -345,8 +345,8 @@ fn activate_deps_loop(
let backtrack = if has_another {
Some(BacktrackFrame {
cur,
context_backup: Context::clone(&cx),
deps_backup: remaining_deps.clone(),
context: Context::clone(&cx),
remaining_deps: remaining_deps.clone(),
remaining_candidates: remaining_candidates.clone(),
parent: Summary::clone(&parent),
dep: Dependency::clone(&dep),
Expand Down Expand Up @@ -555,7 +555,7 @@ fn activate_deps_loop(
// for error messages anyway so we can live with a little
// imprecision.
if let Some(b) = backtrack {
cx = b.context_backup;
cx = b.context;
}
}

Expand Down Expand Up @@ -629,8 +629,8 @@ fn activate(
#[derive(Clone)]
struct BacktrackFrame {
cur: usize,
context_backup: Context,
deps_backup: RemainingDeps,
context: Context,
remaining_deps: RemainingDeps,
remaining_candidates: RemainingCandidates,
parent: Summary,
dep: Dependency,
Expand Down Expand Up @@ -780,7 +780,7 @@ fn find_candidate(
while let Some(mut frame) = backtrack_stack.pop() {
let next = frame.remaining_candidates.next(
&mut frame.conflicting_activations,
&frame.context_backup,
&frame.context,
&frame.dep,
);
let (candidate, has_another) = match next {
Expand All @@ -798,7 +798,7 @@ fn find_candidate(
// completely skip this backtrack frame and move on to the next.
if !backtracked {
if frame
.context_backup
.context
.is_conflicting(Some(parent.package_id()), conflicting_activations)
{
trace!(
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/core/resolver/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ impl ResolverProgress {
config.shell().status("Resolving", "dependency graph...")?;
}
}
// The largest test in our sweet takes less then 5000 ticks
// The largest test in our suite takes less then 5000 ticks
// with all the algorithm improvements.
// If any of them are removed then it takes more than I am willing to measure.
// So lets fail the test fast if we have ben running for two long.
debug_assert!(self.ticks < 50_000);
// The largest test in our sweet takes less then 30 sec
// The largest test in our suite takes less then 30 sec
// with all the improvements to how fast a tick can go.
// If any of them are removed then it takes more than I am willing to measure.
// So lets fail the test fast if we have ben running for two long.
Expand Down
Loading