Skip to content

Commit 0a4aff2

Browse files
authored
docs: docs for -Zfeature-unification (#15189)
### What does this PR try to resolve? Follow-up of <#15157>. Add missing docs for <#14774>. ### How should we test and review this PR? ``` mdbook serve src/doc ```
2 parents ad740fd + 3f49ca8 commit 0a4aff2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/doc/src/reference/unstable.md

+26
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Each new feature described below should explain how to use it.
7575
* [msrv-policy](#msrv-policy) --- MSRV-aware resolver and version selection
7676
* [precise-pre-release](#precise-pre-release) --- Allows pre-release versions to be selected with `update --precise`
7777
* [update-breaking](#update-breaking) --- Allows upgrading to breaking versions with `update --breaking`
78+
* [feature-unification](#feature-unification) --- Enable new feature unification modes in workspaces
7879
* Output behavior
7980
* [artifact-dir](#artifact-dir) --- Adds a directory where artifacts are copied to.
8081
* [Different binary name](#different-binary-name) --- Assign a name to the built binary that is separate from the crate name.
@@ -1740,6 +1741,31 @@ Controls how Cargo handles warnings. Allowed values are:
17401741
* `warn`: warnings are emitted as warnings (default).
17411742
* `allow`: warnings are hidden.
17421743
* `deny`: if warnings are emitted, an error will be raised at the end of the operation and the process will exit with a failure exit code.
1744+
1745+
## feature unification
1746+
1747+
* RFC: [#3692](https://github.com/rust-lang/rfcs/blob/master/text/3692-feature-unification.md)
1748+
* Tracking Issue: [#14774](https://github.com/rust-lang/cargo/issues/14774)
1749+
1750+
The `-Z feature-unification` enables the `resolver.feature-unification`
1751+
configuration option to control how features are unified across a workspace.
1752+
If the `-Z feature-unification` unstable flag is not enabled,
1753+
then the `resolver.feature-unification` configuration will be ignored.
1754+
1755+
### `resolver.feature-unification`
1756+
1757+
* Type: string
1758+
* Default: `"selected"`
1759+
* Environment: `CARGO_RESOLVER_FEATURE_UNIFICATION`
1760+
1761+
Specify which packages participate in [feature unification](../reference/features.html#feature-unification).
1762+
1763+
* `selected`: Merge dependency features from all packages specified for the current build.
1764+
* `workspace`: Merge dependency features across all workspace members,
1765+
regardless of which packages are specified for the current build.
1766+
* `package` _(unimplemented)_: Dependency features are considered on a package-by-package basis,
1767+
preferring duplicate builds of dependencies when different sets of features are activated by the packages.
1768+
17431769
# Stabilized and removed features
17441770

17451771
## Compile progress

0 commit comments

Comments
 (0)