Skip to content

Commit

Permalink
Auto merge of #8169 - ehuss:fix-resolve-warning, r=alexcrichton
Browse files Browse the repository at this point in the history
Fix warning for `resolve` mismatch in workspace.

Using the new `resolve` field would cause a warning in a workspace that the member's resolve setting will be ignored, even if it is not set.

`warning: resolver for the non root package will be ignored, specify resolver at the workspace root:`

The code should only check the package member if the member's value is set.
  • Loading branch information
bors committed Apr 27, 2020
2 parents 7e1011d + 5907db6 commit 2ba9df5
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 2ba9df5

Please sign in to comment.