{"record":{"id":"7bf575a810ac5dcc","repo":"slint-ui/slint","slug":"incorrect-found-expected","errorCode":null,"errorMessage":"Incorrect {}. Found {} expected {}","messagePattern":"Incorrect (.+?)\\. Found (.+?) expected (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/license_headers_check.rs","lineNumber":892,"sourceCode":"                        } else {\n                            return Err(anyhow!(\n                                \"Incorrect {}.workspace found: expected true, found false\",\n                                field,\n                            ));\n                        }\n                    }\n                    None => match field_value.as_str() {\n                        Some(text) => {\n                            if text != expected_str {\n                                if fix_it {\n                                    eprintln!(\n                                        \"Fixing up {:?} as instructed. It has unexpected data in {field}.\",\n                                        self.path\n                                    );\n                                    self.doc[\"package\"][field] = toml_edit::value(expected_str);\n                                    self.edited = true;\n                                } else {\n                                    return Err(anyhow!(\n                                        \"Incorrect {}. Found {} expected {}\",\n                                        field,\n                                        text,\n                                        expected_str\n                                    ));\n                                }\n                            }\n                        }\n                        None => return Err(anyhow!(\"{} field is not a string\", field)),\n                    },\n                };\n            }\n            None => {\n                if fix_it {\n                    eprintln!(\"Fixing up {:?} as instructed. It has no {field}.\", self.path);\n                    self.doc[\"package\"][field] = toml_edit::value(expected_str);\n                    self.edited = true;\n                } else {","sourceCodeStart":874,"sourceCodeEnd":910,"githubUrl":"https://github.com/slint-ui/slint/blob/3a7e700487dc74d404cad0726378053ab763d4e0/xtask/src/license_headers_check.rs#L874-L910","documentation":"This error is thrown by check_and_fix_package_string_field in xtask's license-headers check when a [package] field in a Cargo.toml (e.g. license, homepage, repository) contains a value that differs from the expected canonical string and the check was not run in fix mode. It enforces repo-wide consistency of package metadata.","triggerScenarios":"Running `cargo xtask check` (license-headers check without --fix) on a crate whose Cargo.toml [package] field, e.g. license = \"MIT\", does not exactly equal the expected constant like \"MIT OR Apache-2.0\" or the expected repository URL.","commonSituations":"Adding a new crate with hand-written Cargo.toml metadata; copying Cargo.toml from another project; a field having extra whitespace or a differently formatted URL; license expression spelled differently (e.g. \"Apache-2.0/MIT\").","solutions":["Run `cargo xtask check --fix` so check_and_fix_package_string_field rewrites the field to the expected value automatically","Manually edit the [package] field in the offending Cargo.toml to match the expected string exactly","Check the EXPECTED_* constants in xtask/src/license_headers_check.rs to see the accepted value"],"exampleFix":"// before (Cargo.toml)\nlicense = \"Apache-2.0/MIT\"\n// after\nlicense = \"MIT OR Apache-2.0\"","handlingStrategy":"validation","validationCode":"let t: toml::Value = toml::from_str(&std::fs::read_to_string(\"Cargo.toml\")?)?;\nlet actual = t[\"package\"][\"license\"].as_str().unwrap_or_default();\nassert_eq!(actual, \"MIT OR Apache-2.0\", \"license field mismatch\");","typeGuard":"fn is_expected_field(doc: &toml::Value, field: &str, expected: &str) -> bool {\n    doc[\"package\"][field].as_str() == Some(expected)\n}","tryCatchPattern":null,"preventionTips":["Run `cargo xtask check` locally before committing","Copy [package] metadata from an existing crate when creating new ones","Never hand-edit canonical fields like license/repository; use --fix","Keep Cargo.toml formatting minimal to avoid stray whitespace differences"],"tags":["cargo","cargo-toml","metadata","ci"],"backgroundTag":"invalid-config-value","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"}