What this thread does
Do first: run cargo tree -e features -i dependency with the same package selection and target as the failing build, replacing dependency with the affected crate.
Short answer
As of November 2026, use Rust 1.100.0. Features on a shared dependency combine across selected packages. Set the workspace resolver explicitly and design features to compose; disabling defaults on one edge cannot subtract features requested by another edge (resolver, features).
Choose / don't choose
- Additive features: choose independent capabilities; don't make enabling a feature remove an existing API.
- Backend selection: prefer separate crates or runtime selection if backends must coexist. Use
compile_error!only for unavoidable incompatible combinations, with a documented supported matrix (feature design). - Separate Cargo invocations: choose when workspace members need independently compiled dependency feature sets; don't expect multiple
-pflags to isolate them (resolver).
Not for: workspace edition inheritance and publication errors; see cargo-workspace-edition-publish-plan-gitlab-ci-os-error-2.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
| Workspace resolver | "3" defaults Rust-version policy to fallback; "2" introduces changes in feature unification | Current Cargo docs | resolvers |
default-features | false on dependency edges that must not request defaults; inspect all incoming edges | Current Cargo docs | dependency features |
workspace.dependencies.<crate>.default-features | For older editions/toolchains, package-level default-features = false may be ignored or rejected unless defaults are disabled at workspace level | Current Cargo docs | workspace dependencies |
Member default-features | false may override inherited value for edition 2024 members starting in Rust 1.99.0 | Current Cargo docs | workspace dependencies |
--no-default-features / --features | Disable selected package defaults, then request supported capability names explicitly | Current Cargo docs | build selection |
Resolver 2 separates inactive target features, build/proc-macro features and inactive dev-dependency features from normal dependencies. Resolver 3 preserves that behavior and changes Rust-version preference. Neither disables normal dependency feature unions (resolver).
Order of operations
1. In virtual workspaces set resolver at the root; member edition alone cannot select it (workspace). 2. Use cargo tree -e features to display feature-enabling edges; add -i dependency to invert them. Match the failing target/package/features; tree output approximates compilation and is not exact for every target kind (tree). 3. Align root and member default-feature declarations. The Rust 1.99.0 notes introduce edition-2024 member overrides; the ParkMyCar report records the older inheritance limitation. 4. Build each supported package/target combination with defaults, without defaults and with explicitly supported feature sets. Use final builds as well as checks; cargo check omits code-generation diagnostics (check).
For cargo build -p app -p tool, shared normal dependency features requested by app, tool and their selected dependency paths are unified. Cargo.lock generation nevertheless resolves as if all workspace member features were enabled; actual compilation selects features separately (resolver).
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
| Defaults remain enabled (symptom) | Older inheritance behavior ignores the member’s default-features flag | Trace incoming feature edges; align declarations and respect edition/toolchain boundary | ParkMyCar report, release boundary |
compile_error! rejects simultaneously enabled incompatible features | Two incompatible features are enabled together | Make capabilities composable, split crates or document unavoidable exclusions | feature design |
Missing
- Dependency names and supported combinations are unspecified; no universal all-features build can substitute for the declared matrix.
- A dependency version/native links conflict may require version alignment; changing features alone cannot guarantee resolution.
Checked
2026-11-12; Rust release pages, Cargo resolver/features/workspace/tree/check references and ParkMyCar's dated inheritance report read. No Cargo build commands executed.
Started from a post by @Rust project, packaged by the editor. Original post