{"record":{"id":"7773992cfd7afb75","repo":"slint-ui/slint","slug":"using-workspace-workspace-true-in-workspace","errorCode":null,"errorMessage":"Using workspace {}.workspace = true in workspace","messagePattern":"Using workspace (.+?)\\.workspace = true in workspace","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/license_headers_check.rs","lineNumber":860,"sourceCode":"                    })\n                })\n                .collect(),\n            None => Vec::new(),\n        }\n    }\n\n    fn check_and_fix_package_string_field<'a>(\n        &mut self,\n        fix_it: bool,\n        field: &'a str,\n        expected_str: &'a str,\n    ) -> Result<()> {\n        let is_workspace = self.is_workspace();\n        match self.package()?.get(field) {\n            Some(field_value) => {\n                match field_value.get(\"workspace\").and_then(|v| v.as_bool()) {\n                    Some(true) if is_workspace => {\n                        return Err(anyhow!(\n                            \"Using workspace {}.workspace = true in workspace\",\n                            field\n                        ));\n                    }\n                    Some(true) => { /* nothing to do */ }\n                    Some(false) => {\n                        if fix_it {\n                            eprintln!(\n                                \"Fixing up {:?} as instructed. It has {field}.workspace = false\",\n                                self.path\n                            );\n                            self.doc[\"package\"][field][\"workspace\"] = toml_edit::value(true);\n                            self.edited = true;\n                        } else {\n                            return Err(anyhow!(\n                                \"Incorrect {}.workspace found: expected true, found false\",\n                                field,\n                            ));","sourceCodeStart":842,"sourceCodeEnd":878,"githubUrl":"https://github.com/slint-ui/slint/blob/3a7e700487dc74d404cad0726378053ab763d4e0/xtask/src/license_headers_check.rs#L842-L878","documentation":"check_and_fix_package_string_field found that the workspace root manifest sets `field.workspace = true` inside its own workspace/package section. Inheritance flags only make sense in member crates; the workspace root must hold the concrete value, so this configuration is contradictory and the check fails immediately (no auto-fix).","triggerScenarios":"The manifest is a workspace root (is_workspace() == true) and its package section's field (e.g. version or license) is a table carrying workspace = true, typically produced by blindly copying a member crate's inherited field into the root.","commonSituations":"A script or editor applied `version = { workspace = true }` to the workspace root; a member Cargo.toml was promoted to workspace root without converting inherited fields back to concrete values; copy-paste of a member's package section into [workspace.package].","solutions":["Replace `field = { workspace = true }` in [workspace.package] with the concrete value (e.g. version = \"1.2.3\" or the required license string).","Run the check with --fix after correcting other files; this specific error is never auto-fixed, so edit the root Cargo.toml manually.","Audit how the field got there: revert the copy-paste of member package tables into the workspace root.","Ensure expected_str (the canonical value) is written directly in [workspace.package] so downstream member inheritance resolves."],"exampleFix":"// before: root Cargo.toml\n[workspace.package]\nversion = { workspace = true }\n\n// after\n[workspace.package]\nversion = \"1.2.3\"","handlingStrategy":"validation","validationCode":"fn root_uses_inheritance(doc: &toml_edit::DocumentMut, field: &str) -> bool {\n    doc.as_table().get(\"workspace\")\n        .and_then(|w| w.get(\"package\"))\n        .and_then(|p| p.get(field))\n        .and_then(|f| f.get(\"workspace\")).and_then(|v| v.as_bool())\n        .unwrap_or(false)\n}\n// fail fast before the check: if root_uses_inheritance(&doc, \"version\") { bail!(\"workspace root must hold concrete values\") }","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().starts_with(\"Using workspace \") => {\n        anyhow::bail!(\"workspace root Cargo.toml must not use field.workspace = true; write the concrete value in [workspace.package]\")\n    }\n    other => other,\n}","preventionTips":["Never copy a member's inherited fields ({ workspace = true }) into [workspace.package].","When promoting a member manifest to a workspace root, convert inherited fields to concrete values.","Add a lint/test asserting the root manifest contains only concrete package values.","Review automated TOML edits before committing them."],"tags":["cargo","toml","workspace-inheritance","config","xtask"],"backgroundTag":"conflicting-config-options","analyzedSha":"3a7e700487dc74d404cad0726378053ab763d4e0","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}