slint-ui/slint · error
Incorrect .workspace found: expected true, found false
Error message
Incorrect {}.workspace found: expected true, found false What it means
check_and_fix_package_string_field found a member crate manifest where `field.workspace = false`, but this repository requires every member to inherit that field from [workspace.package] (workspace = true). Unless --fix mode rewrites it to true, the check fails because the crate's field does not follow the workspace inheritance policy.
Solutions
- Run the xtask check in fix mode (e.g. `cargo xtask license-header --fix` style invocation) so it rewrites field.workspace to true automatically.
- Manually change the member's [package] field to `field = { workspace = true }` and confirm the inherited value from [workspace.package] is what you want.
- Remove the explicit field table and rely on inheritance entirely if the crate should share the workspace value.
- If the crate genuinely must not inherit, coordinate the exception in the check configuration instead of leaving workspace = false.
Example fix
// before: member Cargo.toml
[package]
name = "my-crate"
version = { workspace = false }
// after
[package]
name = "my-crate"
version = { workspace = true }
# or simply delete the field so it inherits [workspace.package].version Defensive patterns
Strategy: validation
Validate before calling
fn member_inherits(doc: &toml_edit::DocumentMut, field: &str) -> bool {
doc.as_table().get("package")
.and_then(|p| p.get(field))
.and_then(|f| f.get("workspace")).and_then(|v| v.as_bool())
.unwrap_or(true) // absent flag with concrete string value is a different path
} Try / catch
match cargo xtask-check --fix output {
// run fix mode first; only if it still reports 'Incorrect {field}.workspace found', inspect manually
_ => {}
} Prevention
- New member crates should inherit version/license via field = { workspace = true } from day one.
- Run the xtask check with --fix before committing so false flags are rewritten automatically.
- Watch merges that flip workspace = true to false; treat such diffs as review blockers.
- Keep a CI job running the check in non-fix mode to catch regressions.
When it happens
Trigger: A member (non-workspace) Cargo.toml declares field = { workspace = false } (or a boolean false) in its [package] section, and the check runs without fix_it set, so the `Incorrect {field}.workspace found: expected true, found false` error is returned.
Common situations: A crate was added with explicitly written version/license instead of inheriting; tooling or a merge downgraded `workspace = true` to false; a crate deliberately opted out of inheritance after the workspace standardized on inherited fields.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Using workspace .workspace = true in workspace
- Invalid Cargo.toml -- cannot find package section
- Invalid Cargo.toml -- cannot find workspace package section…
- Not a workspace, can not extract version info.
- cargo failed
AI-assisted analysis of slint-ui/slint@3a7e700487 (2026-09-16).
Data as JSON: /api/errors/5a453a8c4a5447ec.
Report an issue: GitHub.
Appendix: source
Thrown at xtask/src/license_headers_check.rs:875
Some(field_value) => {
match field_value.get("workspace").and_then(|v| v.as_bool()) {
Some(true) if is_workspace => {
return Err(anyhow!(
"Using workspace {}.workspace = true in workspace",
field
));
}
Some(true) => { /* nothing to do */ }
Some(false) => {
if fix_it {
eprintln!(
"Fixing up {:?} as instructed. It has {field}.workspace = false",
self.path
);
self.doc["package"][field]["workspace"] = toml_edit::value(true);
self.edited = true;
} else {
return Err(anyhow!(
"Incorrect {}.workspace found: expected true, found false",
field,
));
}
}
None => match field_value.as_str() {
Some(text) => {
if text != expected_str {
if fix_it {
eprintln!(
"Fixing up {:?} as instructed. It has unexpected data in {field}.",
self.path
);
self.doc["package"][field] = toml_edit::value(expected_str);
self.edited = true;
} else {
return Err(anyhow!(
"Incorrect {}. Found {} expected {}",View on GitHub (pinned to 3a7e700487)