{"id":"e3f199f3bb3b1dbe","repo":"rust-lang/cargo","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/resolver/features.rs","lineNumber":189,"sourceCode":"        ws: &Workspace<'_>,\n        has_dev_units: HasDevUnits,\n        force_all_targets: ForceAllTargets,\n    ) -> CargoResult<FeatureOpts> {\n        let mut opts = FeatureOpts::default();\n        let unstable_flags = ws.gctx().cli_unstable();\n        let mut enable = |feat_opts: &Vec<String>| {\n            for opt in feat_opts {\n                match opt.as_ref() {\n                    \"build_dep\" | \"host_dep\" => opts.decouple_host_deps = true,\n                    \"dev_dep\" => opts.decouple_dev_deps = true,\n                    \"itarget\" => opts.ignore_inactive_targets = true,\n                    \"all\" => {\n                        opts.decouple_host_deps = true;\n                        opts.decouple_dev_deps = true;\n                        opts.ignore_inactive_targets = true;\n                    }\n                    \"compare\" => opts.compare = true,\n                    \"ws\" => unimplemented!(),\n                    s => bail!(\"-Zfeatures flag `{}` is not supported\", s),\n                }\n            }\n            Ok(())\n        };\n        if let Some(feat_opts) = unstable_flags.features.as_ref() {\n            enable(feat_opts)?;\n        }\n        match ws.resolve_behavior() {\n            ResolveBehavior::V1 => {}\n            ResolveBehavior::V2 | ResolveBehavior::V3 => {\n                enable(&vec![\"all\".to_string()]).unwrap();\n            }\n        }\n        if let HasDevUnits::Yes = has_dev_units {\n            // Dev deps cannot be decoupled when they are in use.\n            opts.decouple_dev_deps = false;\n        }","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/rust-lang/cargo/blob/0e07a155371a6ce88ae53a2c00df940280c09a67/src/resolver/features.rs#L171-L207","documentation":"Originates in FeatureOpts::new (src/resolver/features.rs:189). The match over -Zfeatures options handles build_dep, host_dep, dev_dep, itarget, all, and compare, but the \"ws\" (workspace-wide feature unification) arm is a stub that calls unimplemented!(). The unimplemented!() macro panics at runtime with message \"not implemented\" rather than returning a Result. It exists because the workspace-scoped feature resolver variant was designed but never completed.","triggerScenarios":"Passing -Zfeatures=ws on a nightly Cargo invocation (e.g. `cargo +nightly build -Zfeatures=ws`). The value reaches FeatureOpts::new only through ws.gctx().cli_unstable().features when the unstable features flag is populated with the token \"ws\".","commonSituations":"A developer copies the `ws` token from an old Cargo RFC, design doc, or stale blog post without realizing it was never finished. CI pinned to nightly with CARGO_UNSTABLE_FEATURES or a .cargo/config.toml [unstable] features = [\"ws\"] setting. Experimenting with feature-resolver flags documented as in-progress.","solutions":["Remove `ws` from your -Zfeatures value (use `all`, or specific flags like `itarget`, `dev_dep`, `build_dep`).","If you want the broadest decoupling, use -Zfeatures=all which sets decouple_host_deps, decouple_dev_deps, and ignore_inactive_targets.","Check the Cargo version and the tracking issue (rust-lang/cargo) to see whether `ws` has been implemented in your nightly.","Switch to the stabilized v2/v3 resolver (resolver = \"2\"/\"3\" in Cargo.toml) which already enables the `all` flags internally."],"exampleFix":"// before\ncargo +nightly build -Zfeatures=ws\n\n// after\ncargo +nightly build -Zfeatures=all","handlingStrategy":"validation","validationCode":"// Filter unsupported -Zfeatures tokens before they reach FeatureOpts::new\nfn sanitize_features_flags(flags: &mut Vec<String>) {\n    const UNSUPPORTED: &[&str] = &[\"ws\"]; // unimplemented!() arms\n    flags.retain(|f| !UNSUPPORTED.contains(&f.as_str()));\n}\n\n// call before building the workspace / running cargo:\nlet mut f = config.cli_unstable().features.clone().unwrap_or_default();\nsanitize_features_flags(&mut f);","typeGuard":"// True when the -Zfeatures value set is safe (contains no unimplemented arms)\nfn features_flags_are_safe(flags: Option<&Vec<String>>) -> bool {\n    match flags {\n        None => true,\n        Some(v) => !v.iter().any(|s| s == \"ws\"),\n    }\n}","tryCatchPattern":null,"preventionTips":["Never use -Zfeatures=ws; prefer -Zfeatures=all for the broadest decoupling.","Treat any -Zfeatures token not documented in your exact nightly's reference as suspect.","Pin a known-good nightly in CI and assert on the set of unstable feature flags."],"tags":["cargo","nightly","features","unstable","panic","resolver"],"analyzedSha":"0e07a155371a6ce88ae53a2c00df940280c09a67","analyzedAt":"2026-08-06T01:46:58.334Z","schemaVersion":2}