quickwit-oss/quickwit · error · proc-macro compile error
structure doesn't implement serialize but a serializer is de
Error message
structure doesn't implement serialize but a serializer is defined
What it means
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.
Source
Thrown at quickwit/quickwit-macros/src/lib.rs:188
if let Some(field_config) = field_config {
let value = Ident::new("value", Span::call_site());
for field in &field_config.proxy_fields {
final_fields.push(field.clone());
}
match (ser, field_config.get_into(&value)) {
(true, Some((pre_conv, in_conv))) => {
into_pre_conv.push(pre_conv);
into_in_conv.push(in_conv);
}
(false, None) => (),
(true, None) => {
return Err(Error::new(
field_name.span(),
"structure implement serialize but no serializer defined",
));
}
(false, Some(_)) => {
return Err(Error::new(
field_name.span(),
"structure doesn't implement serialize but a serializer is defined",
));
}
}
match (de, field_config.get_try_from(&value)) {
(true, Some(conv)) => {
try_from_conv.push(conv);
}
(false, None) => (),
(true, None) => {
return Err(Error::new(
field_name.span(),
"structure implement deserialize but no deserializer defined",
));
}
(false, Some(_)) => {
return Err(Error::new(View on GitHub (pinned to a39730c5cd)
Solutions
- Add Serialize to the struct's derives if serialization is intended.
- Or remove the unused `into` conversion from the field config.
Example fix
// before
#[derive(Deserialize)]
#[serde_multikey(fields(v(into = to_str)))]
struct Foo { v: u64 }
// after
#[derive(Serialize, Deserialize)]
#[serde_multikey(fields(v(into = to_str)))]
struct Foo { v: u64 } Defensive patterns
Strategy: validation
Validate before calling
// Only define `into` conversions on structs that derive Serialize: // #[derive(Serialize)] or #[derive(Serialize, Deserialize)] + into = ...
Prevention
- 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
When it happens
Trigger: Struct has only #[derive(Deserialize)] (no Serialize) yet a field config in #[serde_multikey(...)] defines an `into`/serializer conversion.
Common situations: Copy-pasting a fully-specified field config from a Serialize+Deserialize struct into a deserialize-only struct.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- `serde_multikey` was applied to a non Serialize/Deserialize
- `serde_multikey` was applied to a tuple-struct or an empty s
- structure implement serialize but no serializer defined
- structure implement deserialize but no deserializer defined
- structure doesn't implement deserialize but a deserializer i
AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08).
Data as JSON: /api/errors/c25f6ea7eaa9f692.
Report an issue: GitHub.