Skip to content

Commit 2ba9df5

Browse files
committed
Auto merge of #8169 - ehuss:fix-resolve-warning, r=alexcrichton
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.
2 parents 7e1011d + 5907db6 commit 2ba9df5

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/cargo/core/workspace.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,9 @@ impl<'cfg> Workspace<'cfg> {
792792
if !manifest.patch().is_empty() {
793793
emit_warning("patch")?;
794794
}
795-
if manifest.resolve_behavior() != self.resolve_behavior {
795+
if manifest.resolve_behavior().is_some()
796+
&& manifest.resolve_behavior() != self.resolve_behavior
797+
{
796798
// Only warn if they don't match.
797799
emit_warning("resolver")?;
798800
}

tests/testsuite/features2.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,17 @@ fn resolver_enables_new_features() {
15921592
p.cargo("run --bin a")
15931593
.masquerade_as_nightly_cargo()
15941594
.env("EXPECTED_FEATS", "1")
1595+
.with_stderr(
1596+
"\
1597+
[UPDATING] [..]
1598+
[DOWNLOADING] crates ...
1599+
[DOWNLOADED] common [..]
1600+
[COMPILING] common v1.0.0
1601+
[COMPILING] a v0.1.0 [..]
1602+
[FINISHED] [..]
1603+
[RUNNING] `target/debug/a[EXE]`
1604+
",
1605+
)
15951606
.run();
15961607

15971608
// only normal+dev

0 commit comments

Comments
 (0)