risingwavelabs/risingwave · error
Missing prefix string argument
Error message
Missing prefix string argument
What it means
Compile-time error raised at the end of parse_args (invoked via try_prefix_all) when the serde prefix attribute was parsed but no prefix string argument was found among its arguments — i.e. the attribute was invoked without the required string literal that gets prepended to field names. It is a mandatory-argument guard; the derive cannot proceed without a prefix.
Solutions
- Add the required string literal prefix to the attribute, e.g. `#[prefix_all("prefix_")]`
- If mode was passed (e.g. `mode = "alias"`), still supply the prefix string argument alongside it
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/common/proc_macro/src/serde_prefix_all.rs:112 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/abea66d6ebe61072.
Report an issue: GitHub.
Appendix: source
Thrown at src/common/proc_macro/src/serde_prefix_all.rs:112
));
}
},
_ => return Err(Error::new(lit.span(), "mode must be a string literal")),
};
mode = Some(parsed_mode);
}
NestedMeta::Meta(meta) => {
return Err(Error::new(
meta.span(),
"Unsupported attribute argument, expected a string literal prefix or mode",
));
}
}
}
let (prefix, span) =
prefix.ok_or_else(|| Error::new(Span::call_site(), "Missing prefix string argument"))?;
Ok(ParsedArgs {
prefix,
prefix_span: span,
mode: mode.unwrap_or(Mode::Rename),
})
}
pub(crate) fn try_prefix_all(
args: AttributeArgs,
mut input: DeriveInput,
) -> syn::Result<TokenStream> {
let ParsedArgs {
prefix,
prefix_span,
mode,
} = parse_args(args)?;
match &mut input.data {View on GitHub (pinned to 6469eb736d)