{"record":{"id":"28a430717189c076","repo":"astral-sh/ruff","slug":"can-only-derive-combine-from-structs","errorCode":null,"errorMessage":"Can only derive Combine from structs.","messagePattern":"Can only derive Combine from structs\\.","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/ruff_macros/src/combine.rs","lineNumber":32,"sourceCode":"                    quote_spanned!(\n                        member.span() => ty_combine::Combine::combine_with(&mut self.#member, other.#member)\n                    )\n                })\n                .collect();\n\n            Ok(quote! {\n                #[automatically_derived]\n                impl ty_combine::Combine for #ident {\n                    #[allow(deprecated)]\n                    fn combine_with(&mut self, other: Self) {\n                        #(\n                            #output\n                        );*\n                    }\n                }\n            })\n        }\n        _ => Err(syn::Error::new(\n            ident.span(),\n            \"Can only derive Combine from structs.\",\n        )),\n    }\n}\n","sourceCodeStart":14,"sourceCodeEnd":38,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ruff_macros/src/combine.rs#L14-L38","documentation":"A syn compile error from the Combine derive macro: it was applied to something other than a struct (e.g. an enum or union). The derive generates field-by-field combine_with logic, which only makes sense for structs.","triggerScenarios":"Thrown at crates/ruff_macros/src/combine.rs:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Implement ty_combine::Combine manually for the non-struct type","Apply the derive only to structs"],"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-14T00:17:10.932Z"}