{"record":{"id":"54394e3b7b37b5c7","repo":"quickwit-oss/quickwit","slug":"structure-doesn-t-implement-deserialize-but-a-dese","errorCode":null,"errorMessage":"structure doesn't implement deserialize but a deserializer is defined","messagePattern":"structure doesn't implement deserialize but a deserializer is defined","errorType":"exception","errorClass":"proc-macro compile error","httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-macros/src/lib.rs","lineNumber":206,"sourceCode":"                    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(\n                        field_name.span(),\n                        \"structure doesn't implement deserialize but a deserializer is defined\",\n                    ));\n                }\n            }\n        } else {\n            pass_through.push(field_name);\n            final_fields.push(field);\n            if let Some(ponct) = ponct {\n                final_fields.push_punct(ponct);\n            }\n        }\n    }\n    input.fields = Fields::Named(FieldsNamed {\n        brace_token,\n        named: final_fields,\n    });\n","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-macros/src/lib.rs#L188-L224","documentation":"The inverse of error 327: a field declares a `try_from` (deserializer) conversion but the struct does not implement Deserialize, so the conversion would be unused. The macro rejects this inconsistency at compile time.","triggerScenarios":"Struct has only #[derive(Serialize)] (no Deserialize) yet a field config in #[serde_multikey(...)] defines a `try_from`/deserializer conversion.","commonSituations":"Copy-pasting a fully-specified field config from a Serialize+Deserialize struct into a serialize-only struct.","solutions":["Add Deserialize to the struct's derives if deserialization is intended.","Or remove the unused `try_from` conversion from the field config."],"exampleFix":"// before\n#[derive(Serialize)]\n#[serde_multikey(fields(v(try_from = from_str)))]\nstruct Foo { v: u64 }\n// after\n#[derive(Serialize, Deserialize)]\n#[serde_multikey(fields(v(try_from = from_str)))]\nstruct Foo { v: u64 }","handlingStrategy":"validation","validationCode":"// Only define `try_from` conversions on structs that derive Deserialize:\n// #[derive(Deserialize)] or #[derive(Serialize, Deserialize)] + try_from = ...","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep derive list and field conversions consistent: Deserialize implies `try_from` 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"}