{"record":{"id":"5e3b6b51a569c6ad","repo":"quickwit-oss/quickwit","slug":"serde-multikey-require-list-style-arguments","errorCode":null,"errorMessage":"`serde_multikey` require list-style arguments","messagePattern":"`serde_multikey` require list-style arguments","errorType":"exception","errorClass":"proc-macro compile error","httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-macros/src/lib.rs","lineNumber":470,"sourceCode":"\nfn parse_attributes(\n    attributes: Vec<Attribute>,\n    field_name: &Ident,\n) -> Result<(Option<MultiKeyOptions>, Vec<Attribute>), Error> {\n    let (mut multikey_attributes, normal_attributes): (Vec<_>, _) = attributes\n        .into_iter()\n        .partition(|attr| attr.path().is_ident(\"serde_multikey\"));\n\n    if multikey_attributes.len() > 1 {\n        let last = multikey_attributes.last().unwrap();\n        return Err(Error::new(\n            last.pound_token.spans[0],\n            \"`serde_multikey` was applied multiple time to the same field\",\n        ));\n    }\n    let options = if let Some(multikey_attribute) = multikey_attributes.pop() {\n        let Meta::List(meta_list) = multikey_attribute.meta else {\n            return Err(Error::new(\n                multikey_attribute.pound_token.spans[0],\n                \"`serde_multikey` require list-style arguments\",\n            ));\n        };\n        let mut options: MultiKeyOptions = syn::parse2(meta_list.tokens)?;\n        options.main_field_name = field_name.clone();\n        Some(options)\n    } else {\n        None\n    };\n\n    Ok((options, normal_attributes))\n}\n","sourceCodeStart":452,"sourceCodeEnd":484,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-macros/src/lib.rs#L452-L484","documentation":"The `#[serde_multikey]` attribute must be written in list form — `#[serde_multikey(...)]`. If the macro sees it used as a path (`#[serde_multikey]`) or name-value form (`#[serde_multikey = \"x\"]`), `parse_attributes` rejects it because MultiKeyOptions can only be parsed from the parenthesized token list.","triggerScenarios":"Compiling a field annotated with bare `#[serde_multikey]` or `#[serde_multikey = \"something\"]` instead of `#[serde_multikey(options...)]`.","commonSituations":"Following outdated documentation that showed the attribute without arguments; writing `#[serde_multikey = \"true\"]` by analogy with boolean serde attributes; a typo stripping the parentheses.","solutions":["Rewrite the attribute in list form, e.g. `#[serde_multikey(main_key = \"...\", sub_key = \"...\")]`.","Check the MultiKeyOptions struct in quickwit-macros for the accepted argument names and pass them inside the parentheses.","If the attribute was intended as a no-op marker, delete it entirely."],"exampleFix":"// before\n#[serde_multikey]\nmy_field: MyType,\n// after\n#[serde_multikey(main_key = \"timestamp\", sub_key = \"source\")]\nmy_field: MyType,","handlingStrategy":"validation","validationCode":"// attribute must be list-style: check before compiling\n// #[serde_multikey(...)]  OK\n// #[serde_multikey] or #[serde_multikey = \"x\"]  ERROR","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass arguments inside parentheses: `#[serde_multikey(key = \"...\")]`.","Copy the attribute usage from an existing working field in the codebase.","Consult MultiKeyOptions in quickwit-macros for the accepted keys."],"tags":["proc-macro","rust","compile-time","attribute-format"],"backgroundTag":"invalid-argument-format","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}