{"record":{"id":"c25f6ea7eaa9f692","repo":"quickwit-oss/quickwit","slug":"structure-doesn-t-implement-serialize-but-a-serial","errorCode":null,"errorMessage":"structure doesn't implement serialize but a serializer is defined","messagePattern":"structure doesn't implement serialize but a serializer is defined","errorType":"exception","errorClass":"proc-macro compile error","httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-macros/src/lib.rs","lineNumber":188,"sourceCode":"        if let Some(field_config) = field_config {\n            let value = Ident::new(\"value\", Span::call_site());\n            for field in &field_config.proxy_fields {\n                final_fields.push(field.clone());\n            }\n            match (ser, field_config.get_into(&value)) {\n                (true, Some((pre_conv, in_conv))) => {\n                    into_pre_conv.push(pre_conv);\n                    into_in_conv.push(in_conv);\n                }\n                (false, None) => (),\n                (true, None) => {\n                    return Err(Error::new(\n                        field_name.span(),\n                        \"structure implement serialize but no serializer defined\",\n                    ));\n                }\n                (false, Some(_)) => {\n                    return Err(Error::new(\n                        field_name.span(),\n                        \"structure doesn't implement serialize but a serializer is defined\",\n                    ));\n                }\n            }\n            match (de, field_config.get_try_from(&value)) {\n                (true, Some(conv)) => {\n                    try_from_conv.push(conv);\n                }\n                (false, None) => (),\n                (true, None) => {\n                    return Err(Error::new(\n                        field_name.span(),\n                        \"structure implement deserialize but no deserializer defined\",\n                    ));\n                }\n                (false, Some(_)) => {\n                    return Err(Error::new(","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-macros/src/lib.rs#L170-L206","documentation":"The inverse of error 325: a field declares an `into` (serializer) conversion but the struct does not implement Serialize, so the conversion would be dead code. The macro rejects this inconsistency at compile time.","triggerScenarios":"Struct has only #[derive(Deserialize)] (no Serialize) yet a field config in #[serde_multikey(...)] defines an `into`/serializer conversion.","commonSituations":"Copy-pasting a fully-specified field config from a Serialize+Deserialize struct into a deserialize-only struct.","solutions":["Add Serialize to the struct's derives if serialization is intended.","Or remove the unused `into` conversion from the field config."],"exampleFix":"// before\n#[derive(Deserialize)]\n#[serde_multikey(fields(v(into = to_str)))]\nstruct Foo { v: u64 }\n// after\n#[derive(Serialize, Deserialize)]\n#[serde_multikey(fields(v(into = to_str)))]\nstruct Foo { v: u64 }","handlingStrategy":"validation","validationCode":"// Only define `into` conversions on structs that derive Serialize:\n// #[derive(Serialize)] or #[derive(Serialize, Deserialize)] + into = ...","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep derive list and field conversions consistent: Serialize implies `into` needed","When copy-pasting field configs, prune conversions not applicable to the target struct","Let CI compile (cargo check) catch inconsistencies before merge"],"tags":["rust","proc-macro","serde","compile-time"],"backgroundTag":"conflicting-config-options","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}