Skip to content

Commit 7c0088c

Browse files
authored
Merge pull request #267 from ehuss/resolver-workspace
Clarify cargo resolver behavior in a workspace.
2 parents 2d9b1b9 + 2a30bb6 commit 7c0088c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/rust-2021/default-cargo-resolver.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@ which can be activated with `resolver = "2"` in `Cargo.toml`.
1212
Starting in Rust 2021, this will be the default.
1313
That is, writing `edition = "2021"` in `Cargo.toml` will imply `resolver = "2"`.
1414

15+
The resolver is a global setting for a [workspace], and the setting is ignored in dependencies.
16+
The setting is only honored for the top-level package of the workspace.
17+
If you are using a [virtual workspace], you will still need to explicitly set the [`resolver` field]
18+
in the `[workspace]` definition if you want to opt-in to the new resolver.
19+
1520
The new feature resolver no longer merges all requested features for
1621
crates that are depended on in multiple ways.
1722
See [the announcement of Rust 1.51][5] for details.
1823

1924
[4]: ../../cargo/reference/resolver.html#feature-resolver-version-2
2025
[5]: https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver
26+
[workspace]: ../../cargo/reference/workspaces.html
27+
[virtual workspace]: ../../cargo/reference/workspaces.html#virtual-manifest
28+
[`resolver` field]: ../../cargo/reference/resolver.html#resolver-versions
2129

2230
## Migration
2331

0 commit comments

Comments
 (0)