Skip to content

Commit

Permalink
Fix warning for resolve mismatch in workspace.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Apr 27, 2020
1 parent 7e1011d commit 5907db6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cargo/core/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")?;
}
Expand Down
11 changes: 11 additions & 0 deletions tests/testsuite/features2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5907db6

Please sign in to comment.