From 5907db65995084acc5d84ce81630336ad96afcda Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 27 Apr 2020 14:16:41 -0700 Subject: [PATCH] Fix warning for `resolve` mismatch in workspace. --- src/cargo/core/workspace.rs | 4 +++- tests/testsuite/features2.rs | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cargo/core/workspace.rs b/src/cargo/core/workspace.rs index 38428229b12..5931a9a5c7f 100644 --- a/src/cargo/core/workspace.rs +++ b/src/cargo/core/workspace.rs @@ -792,7 +792,9 @@ impl<'cfg> Workspace<'cfg> { if !manifest.patch().is_empty() { emit_warning("patch")?; } - if manifest.resolve_behavior() != self.resolve_behavior { + if manifest.resolve_behavior().is_some() + && manifest.resolve_behavior() != self.resolve_behavior + { // Only warn if they don't match. emit_warning("resolver")?; } diff --git a/tests/testsuite/features2.rs b/tests/testsuite/features2.rs index e6f729263fe..d42fa7a6fe5 100644 --- a/tests/testsuite/features2.rs +++ b/tests/testsuite/features2.rs @@ -1592,6 +1592,17 @@ fn resolver_enables_new_features() { p.cargo("run --bin a") .masquerade_as_nightly_cargo() .env("EXPECTED_FEATS", "1") + .with_stderr( + "\ +[UPDATING] [..] +[DOWNLOADING] crates ... +[DOWNLOADED] common [..] +[COMPILING] common v1.0.0 +[COMPILING] a v0.1.0 [..] +[FINISHED] [..] +[RUNNING] `target/debug/a[EXE]` +", + ) .run(); // only normal+dev