{"record":{"id":"dd0345dacaf9ace6","repo":"astral-sh/ruff","slug":"can-only-derive-combineoptions-from-structs-with-n","errorCode":null,"errorMessage":"Can only derive CombineOptions from structs with named fields.","messagePattern":"Can only derive CombineOptions from structs with named fields\\.","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/ruff_macros/src/combine_options.rs","lineNumber":32,"sourceCode":"                .iter()\n                .map(handle_field)\n                .collect::<Result<Vec<_>, _>>()?;\n\n            Ok(quote! {\n                #[automatically_derived]\n                impl crate::configuration::CombinePluginOptions for #ident {\n                    fn combine(self, other: Self) -> Self {\n                        #[expect(deprecated)]\n                        Self {\n                        #(\n                            #output\n                        ),*\n                        }\n                    }\n                }\n            })\n        }\n        _ => Err(syn::Error::new(\n            ident.span(),\n            \"Can only derive CombineOptions from structs with named fields.\",\n        )),\n    }\n}\n\nfn handle_field(field: &Field) -> syn::Result<proc_macro2::TokenStream> {\n    let ident = field\n        .ident\n        .as_ref()\n        .expect(\"Expected to handle named fields\");\n\n    match &field.ty {\n        Type::Path(TypePath {\n            path: Path { segments, .. },\n            ..\n        }) => match segments.first() {\n            Some(PathSegment {","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ruff_macros/src/combine_options.rs#L14-L50","documentation":"A syn compile error from the CombineOptions derive macro: the target is not a struct with named fields (tuple struct, unit struct, enum, or union). The generated combine logic assigns fields by name, so other shapes are rejected.","triggerScenarios":"Thrown at crates/ruff_macros/src/combine_options.rs:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give the struct named fields","Implement CombineOptions manually for this shape"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26f38c119cac42e4d320ba08f09224fdec74af2c","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}