{"record":{"id":"594ed19e5541dc3c","repo":"risingwavelabs/risingwave","slug":"unsupported-attribute-argument-expected-a-string","errorCode":null,"errorMessage":"Unsupported attribute argument, expected a string literal prefix or mode","messagePattern":"Unsupported attribute argument, expected a string literal prefix or mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/common/proc_macro/src/serde_prefix_all.rs","lineNumber":103,"sourceCode":"\n                let parsed_mode = match lit {\n                    Lit::Str(lit_str) => match lit_str.value().as_str() {\n                        \"rename\" => Mode::Rename,\n                        \"alias\" => Mode::Alias,\n                        _ => {\n                            return Err(Error::new(\n                                lit_str.span(),\n                                \"mode must be \\\"rename\\\" or \\\"alias\\\"\",\n                            ));\n                        }\n                    },\n                    _ => return Err(Error::new(lit.span(), \"mode must be a string literal\")),\n                };\n\n                mode = Some(parsed_mode);\n            }\n            NestedMeta::Meta(meta) => {\n                return Err(Error::new(\n                    meta.span(),\n                    \"Unsupported attribute argument, expected a string literal prefix or mode\",\n                ));\n            }\n        }\n    }\n\n    let (prefix, span) =\n        prefix.ok_or_else(|| Error::new(Span::call_site(), \"Missing prefix string argument\"))?;\n    Ok(ParsedArgs {\n        prefix,\n        prefix_span: span,\n        mode: mode.unwrap_or(Mode::Rename),\n    })\n}\n\npub(crate) fn try_prefix_all(\n    args: AttributeArgs,","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/common/proc_macro/src/serde_prefix_all.rs#L85-L121","documentation":"Compile-time error from the proc-macro attribute parser parse_args (invoked via try_prefix_all for the serde prefix attribute): a nested attribute argument was given that is neither a string literal prefix nor a recognized `mode = ...` entry. If a mode value was supplied but is not \"rename\" or \"alias\", this sentinel fires (also used generically when a non-literal appears where a mode literal is expected). Fix the attribute usage; the macro will not compile otherwise.","triggerScenarios":"Thrown at src/common/proc_macro/src/serde_prefix_all.rs:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use only supported argument forms: a string literal prefix, e.g. `#[prefix_all(\"field_\")]`, or `mode = \"rename\"` / `mode = \"alias\"`","Correct the mode spelling to exactly \"rename\" or \"alias\"","Ensure the mode argument is a string literal, not a variable, ident, or other literal type","Remove unsupported nested meta arguments from the attribute"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}