{"record":{"id":"2535c89a7aee9a57","repo":"rust-lang/cargo","slug":"ignoring-resolver-feature-unification-without","errorCode":null,"errorMessage":"ignoring `resolver.feature-unification` without `-Zfeature-unification`","messagePattern":"ignoring `resolver\\.feature-unification` without `-Zfeature-unification`","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/workspace/workspace.rs","lineNumber":358,"sourceCode":"            ResolveBehavior::V3 => {\n                if self.resolve_behavior == ResolveBehavior::V3 {\n                    self.resolve_honors_rust_version = true;\n                }\n            }\n        }\n        let config = self.gctx().get::<CargoResolverConfig>(\"resolver\")?;\n        if let Some(incompatible_rust_versions) = config.incompatible_rust_versions {\n            self.resolve_honors_rust_version =\n                incompatible_rust_versions == IncompatibleRustVersions::Fallback;\n        }\n        if self.gctx().cli_unstable().feature_unification {\n            self.resolve_feature_unification = config\n                .feature_unification\n                .unwrap_or(FeatureUnification::Selected);\n        } else if config.feature_unification.is_some() {\n            self.gctx()\n                .shell()\n                .warn(\"ignoring `resolver.feature-unification` without `-Zfeature-unification`\")?;\n        };\n\n        if let Some(lockfile_path) = config.lockfile_path {\n            // Reserve the ability to add templates in the future.\n            let replacements: [(&str, &str); 0] = [];\n            let path = lockfile_path\n                    .resolve_templated_path(self.gctx(), replacements)\n                    .map_err(|e| match e {\n                        context::ResolveTemplateError::UnexpectedVariable {\n                            variable,\n                            raw_template,\n                        } => {\n                            anyhow!(\n                                \"unexpected variable `{variable}` in resolver.lockfile-path `{raw_template}`\"\n                            )\n                        }\n                        context::ResolveTemplateError::UnexpectedBracket { bracket_type, raw_template } => {\n                            let (btype, literal) = match bracket_type {","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/rust-lang/cargo/blob/42eee92bc9aa4449f4e25d84e4ceb1cf8e0f87f9/src/workspace/workspace.rs#L340-L376","documentation":"In `Workspace::set_resolve_behavior`, the `resolver.feature-unification` config key is only honored under the unstable `-Zfeature-unification` flag. When the key is set in config but the flag is absent, Cargo emits this warning and ignores the setting (falling back to default unification behavior).","triggerScenarios":"Configuring `resolver.feature-unification = \"selected\"` (or similar) in .cargo/config.toml while building with stable Rust or without `-Zfeature-unification` on nightly.","commonSituations":"Teams adopting the new feature-unification setting from nightly docs, then running stable CI builds; copy-pasted config from projects using nightly features; forgetting to add `-Z feature-unification` or `cargo +nightly -Z ...`.","solutions":["Run with nightly and pass `-Zfeature-unification` (e.g. `cargo +nightly -Zfeature-unification build`) so the setting takes effect.","Alternatively remove `resolver.feature-unification` from .cargo/config.toml to silence the warning if default behavior is acceptable.","Set `CARGO_UNSTABLE_FEATURE_UNIFICATION=true` in environments where passing -Z on the CLI is impractical.","Verify cargo version supports the feature (check `cargo -Z help`)."],"exampleFix":"// before (.cargo/config.toml, stable build)\n[resolver]\nfeature-unification = \"selected\"\n// after: run with\n// cargo +nightly -Zfeature-unification build\n// or remove the [resolver] section","handlingStrategy":"validation","validationCode":"// in CI, before invoking cargo\nif grep -q 'feature-unification' .cargo/config.toml; then\n  case \"$CARGO_CHANNEL\" in *nightly*) ;; *) echo \"requires -Zfeature-unification on nightly\"; exit 1;; esac\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep unstable cargo config keys and their required -Z flags documented together in the repo.","Pin the nightly toolchain (rust-toolchain.toml) whenever unstable resolver config is used.","Treat cargo warnings in CI as failures (`RUSTFLAGS`/log scanning) so ignored-config warnings surface early.","Only add `resolver.feature-unification` after confirming the whole team/CI runs nightly with -Zfeature-unification."],"tags":["cargo","unstable-flags","config","warning"],"backgroundTag":"feature-not-enabled","analyzedSha":"42eee92bc9aa4449f4e25d84e4ceb1cf8e0f87f9","analyzedAt":"2026-09-08T04:50:20.151Z","contentChangedAt":"2026-09-08T04:50:20.151Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}