Fix warning for resolve mismatch in workspace.

This commit is contained in:
Eric Huss 2020-04-27 14:16:41 -07:00
parent 7e1011d27e
commit 5907db6599
2 changed files with 14 additions and 1 deletions

View file

@ -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")?;
}

View file

@ -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