Skip to content

Commit

Permalink
docs: docs for -Zfeature-unification (#15189)
Browse files Browse the repository at this point in the history
### 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
```
  • Loading branch information
ehuss authored Feb 15, 2025
2 parents ad740fd + 3f49ca8 commit 0a4aff2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/doc/src/reference/unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Each new feature described below should explain how to use it.
* [msrv-policy](#msrv-policy) --- MSRV-aware resolver and version selection
* [precise-pre-release](#precise-pre-release) --- Allows pre-release versions to be selected with `update --precise`
* [update-breaking](#update-breaking) --- Allows upgrading to breaking versions with `update --breaking`
* [feature-unification](#feature-unification) --- Enable new feature unification modes in workspaces
* Output behavior
* [artifact-dir](#artifact-dir) --- Adds a directory where artifacts are copied to.
* [Different binary name](#different-binary-name) --- Assign a name to the built binary that is separate from the crate name.
Expand Down Expand Up @@ -1740,6 +1741,31 @@ Controls how Cargo handles warnings. Allowed values are:
* `warn`: warnings are emitted as warnings (default).
* `allow`: warnings are hidden.
* `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.

## feature unification

* RFC: [#3692](https://github.com/rust-lang/rfcs/blob/master/text/3692-feature-unification.md)
* Tracking Issue: [#14774](https://github.com/rust-lang/cargo/issues/14774)

The `-Z feature-unification` enables the `resolver.feature-unification`
configuration option to control how features are unified across a workspace.
If the `-Z feature-unification` unstable flag is not enabled,
then the `resolver.feature-unification` configuration will be ignored.

### `resolver.feature-unification`

* Type: string
* Default: `"selected"`
* Environment: `CARGO_RESOLVER_FEATURE_UNIFICATION`

Specify which packages participate in [feature unification](../reference/features.html#feature-unification).

* `selected`: Merge dependency features from all packages specified for the current build.
* `workspace`: Merge dependency features across all workspace members,
regardless of which packages are specified for the current build.
* `package` _(unimplemented)_: Dependency features are considered on a package-by-package basis,
preferring duplicate builds of dependencies when different sets of features are activated by the packages.

# Stabilized and removed features

## Compile progress
Expand Down

0 comments on commit 0a4aff2

Please sign in to comment.