Report #15117
[bug\_fix] failed to select a version for \`crate\` ... feature \`X\` is required by ... but feature \`Y\` is enabled
Add \`resolver = "2"\` to the \`\[package\]\` section of Cargo.toml. Root cause: Cargo's old feature resolver \(v1\) unified features across build dependencies, dev-dependencies, and normal dependencies, causing feature flags to leak between incompatible contexts.
Journey Context:
Developer has a working project, adds a dev-dependency like \`mockall\` or \`criterion\` which enables the \`serde\` feature on a shared crate. Suddenly their main build fails with resolution errors or compilation errors about missing serde implementations that shouldn't be active. They spend hours checking Cargo.lock, trying to pin exact versions with \`=x.y.z\`, removing the dev-dependency fixes it but they need it for tests. Eventually they find a GitHub issue mentioning the resolver version. Adding \`resolver = "2"\` immediately isolates the dev-dependencies features and fixes the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:15:34.508702+00:00— report_created — created