quickwit-oss/quickwit · error · proc-macro compile error
structure implement deserialize but no deserializer defined
Error message
structure implement deserialize but no deserializer defined
What it means
In generate_proxy_struct, each field can declare a `try_from` (deserializer) conversion. If the struct implements Deserialize but a deserialized field has no `try_from` conversion defined, the macro cannot construct that field from the input and emits this error.
Source
Thrown at quickwit/quickwit-macros/src/lib.rs:200
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(
field_name.span(),
"structure doesn't implement deserialize but a deserializer is defined",
));
}
}
} else {
pass_through.push(field_name);
final_fields.push(field);
if let Some(ponct) = ponct {
final_fields.push_punct(ponct);
}
}View on GitHub (pinned to a39730c5cd)
Solutions
- Define the deserializer conversion for the field (e.g. `try_from = ...`) in the field's serde_multikey config.
- Or exclude the field from the deserialization path if it should not be deserialized.
Example fix
// before
#[serde_multikey(
fields(value)
)]
// after
#[serde_multikey(
fields(value(try_from = parse_value))
)] Defensive patterns
Strategy: validation
Validate before calling
// For every field in fields(...) of a Deserialize struct, ensure a `try_from` conversion exists: // #[serde_multikey(fields(value(try_from = parse_value)))]
Prevention
- Whenever adding a field to a deserialized multikey struct, add its `try_from` conversion at the same time
- Review the fields(...) config whenever the struct changes
- Run cargo check frequently: the macro reports this at compile time
When it happens
Trigger: The struct has a Deserialize impl/derive, and a field in the deserialization path lacks the required `try_from = ...` conversion in its serde_multikey field config.
Common situations: Adding a new field to a deserialized multikey struct without adding its `try_from` conversion; removing a conversion during refactoring.
Understand the failure class
Background: "Must pass :limit option" / "Missing required option" — required option errors explained — this error's family across 41 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 doesn't implement serialize but a serializer is de
- 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/1416a5b49fdf595e.
Report an issue: GitHub.