{"record":{"id":"83616046bcc2da67","repo":"quickwit-oss/quickwit","slug":"structure-implement-serialize-but-no-serializer-de","errorCode":null,"errorMessage":"structure implement serialize but no serializer defined","messagePattern":"structure implement serialize but no serializer defined","errorType":"exception","errorClass":"proc-macro compile error","httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-macros/src/lib.rs","lineNumber":182,"sourceCode":"        // we are in a \"normal\" struct, not a tuple-struct, unwrap is fine.\n        let field_name = field.ident.clone().unwrap();\n\n        let (field_config, attrs) = parse_attributes(field.attrs, &field_name)?;\n        field.attrs = attrs;\n\n        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(","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-macros/src/lib.rs#L164-L200","documentation":"In generate_proxy_struct, each field annotated with serde_multikey options can declare an `into` (serializer) conversion. If the struct itself implements Serialize but a serialized field has no `into` conversion defined, the macro cannot serialize that field and emits this error at the field's span.","triggerScenarios":"The struct has a Serialize impl/derive, and #[serde_multikey(fields(...))] includes a field in the serialization path whose field config lacks an `into`/serializer conversion while that field is set for serialization.","commonSituations":"Adding a new field to a serialized multikey struct without adding its `into = ...` conversion; copy-pasting field configs from a deserialize-only struct.","solutions":["Define the serializer conversion for the field (e.g. `into = ...` / try_into mapping) in the field's serde_multikey config.","Or mark the field so it is not part of the serialized form (skip it) if it should not be serialized."],"exampleFix":"// before\n#[serde_multikey(\n    fields(value)\n)]\n// after\n#[serde_multikey(\n    fields(value(into = into_str))\n)]","handlingStrategy":"validation","validationCode":"// For every field in fields(...) of a Serialize struct, ensure an `into` conversion exists:\n// #[serde_multikey(fields(value(into = convert_value)))]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whenever adding a field to a serialized multikey struct, add its `into` conversion at the same time","List all serialized fields explicitly in the fields(...) config and review it in code review","Compile early after attribute edits: these are compile-time errors"],"tags":["rust","proc-macro","serde","compile-time"],"backgroundTag":"missing-required-option","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"}