quickwit-oss/quickwit · error · proc-macro compile error
structure implement serialize but no serializer defined
Error message
structure implement serialize but no serializer defined
What it means
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.
Source
Thrown at quickwit/quickwit-macros/src/lib.rs:182
// we are in a "normal" struct, not a tuple-struct, unwrap is fine.
let field_name = field.ident.clone().unwrap();
let (field_config, attrs) = parse_attributes(field.attrs, &field_name)?;
field.attrs = attrs;
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(View on GitHub (pinned to a39730c5cd)
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.
Example fix
// before
#[serde_multikey(
fields(value)
)]
// after
#[serde_multikey(
fields(value(into = into_str))
)] Defensive patterns
Strategy: validation
Validate before calling
// For every field in fields(...) of a Serialize struct, ensure an `into` conversion exists: // #[serde_multikey(fields(value(into = convert_value)))]
Prevention
- 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
When it happens
Trigger: 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.
Common situations: Adding a new field to a serialized multikey struct without adding its `into = ...` conversion; copy-pasting field configs from a deserialize-only struct.
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 doesn't implement serialize but a serializer is de
- 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/83616046bcc2da67.
Report an issue: GitHub.