{"record":{"id":"9063113096184684","repo":"slint-ui/slint","slug":"cannot-parse-err","errorCode":null,"errorMessage":"cannot parse {}: {err}","messagePattern":"cannot parse (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/node/build.rs","lineNumber":554,"sourceCode":"    /// Whether the variant is `#[doc(hidden)]`.\n    hidden: bool,\n    fields: Vec<RustField>,\n}\n\nstruct RustField {\n    /// `None` for a field of a tuple variant.\n    name: Option<String>,\n    js_name: Option<String>,\n    /// Last segment of the field's type path.\n    ty: String,\n    docs: Vec<String>,\n}\n\nfn parse_rust_enum(path: &std::path::Path, name: &str) -> RustEnum {\n    let source = std::fs::read_to_string(path)\n        .unwrap_or_else(|err| panic!(\"cannot read {}: {err}\", path.display()));\n    let file = syn::parse_file(&source)\n        .unwrap_or_else(|err| panic!(\"cannot parse {}: {err}\", path.display()));\n    let item = file\n        .items\n        .iter()\n        .find_map(|item| match item {\n            syn::Item::Enum(item) if item.ident == name => Some(item),\n            _ => None,\n        })\n        .unwrap_or_else(|| panic!(\"no `enum {name}` in {}\", path.display()));\n\n    RustEnum {\n        docs: doc_lines(&item.attrs),\n        attrs: item.attrs.clone(),\n        variants: item\n            .variants\n            .iter()\n            .map(|variant| RustVariant {\n                name: variant.ident.to_string(),\n                docs: doc_lines(&variant.attrs),","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/api/node/build.rs#L536-L572","documentation":"After reading the enum source, parse_rust_enum hands it to syn::parse_file; this panic is that Result's error handler. It means the referenced .rs file is not syntactically valid Rust from syn's point of view — usually an in-progress edit that broke syntax, or an exotic/unstable syntax the pinned syn version rejects. The build stops instead of generating bindings from a half-parsed file.","triggerScenarios":"Thrown at api/node/build.rs:554 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the {err} details for the syn parse error and line/column; fix the syntax error or unsupported construct in the referenced enum source file","Check that the source parses with the syn version pinned by the build script; a syn major-version bump can reject previously valid syntax","If the file uses cfg-gated syntax that hides an enum under the active feature set, adjust features so a parseable variant is visible"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}