{"record":{"id":"5d34a663a6e0badc","repo":"slint-ui/slint","slug":"no-enum-name-in","errorCode":null,"errorMessage":"no `enum {name}` in {}","messagePattern":"no `enum (.+?)` in (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/node/build.rs","lineNumber":562,"sourceCode":"    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),\n                hidden: is_doc_hidden(&variant.attrs),\n                fields: variant\n                    .fields\n                    .iter()\n                    .map(|field| RustField {\n                        name: field.ident.as_ref().map(|ident| ident.to_string()),\n                        js_name: napi_arg(&field.attrs, \"js_name\"),\n                        ty: type_name(&field.ty),","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/api/node/build.rs#L544-L580","documentation":"parse_rust_enum searches the parsed file for a top-level enum with the requested name and panics when find_map yields nothing. It is a structural guard: the expected `enum {name}` is absent from that file, meaning the enum was renamed, moved to another module, or deleted while the build script still points at the old location/name.","triggerScenarios":"Thrown at api/node/build.rs:562 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the enum named {name} still exists in the referenced source file; it may have been renamed or removed","Update the path passed to parse_rust_enum from generate_window_event_module if the enum moved to another module","If the enum was renamed, rename the lookup string in the build script to match"],"exampleFix":null,"handlingStrategy":"validation","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"}