{"record":{"id":"2a9a22ef4a651449","repo":"block/buzz","slug":"expected-name-system-or-fields","errorCode":null,"errorMessage":"expected `name`, `system`, or `fields`","messagePattern":"expected `name`, `system`, or `fields`","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/buzz-datastore-tracing/src/lib.rs","lineNumber":49,"sourceCode":"                    name = Some(input.parse()?);\n                }\n                \"system\" => {\n                    if system.is_some() {\n                        return Err(Error::new(key.span(), \"duplicate `system` argument\"));\n                    }\n                    input.parse::<Token![=]>()?;\n                    system = Some(input.parse()?);\n                }\n                \"fields\" => {\n                    if fields.is_some() {\n                        return Err(Error::new(key.span(), \"duplicate `fields` argument\"));\n                    }\n                    let content;\n                    parenthesized!(content in input);\n                    fields = Some(content.parse()?);\n                }\n                _ => {\n                    return Err(Error::new(\n                        key.span(),\n                        \"expected `name`, `system`, or `fields`\",\n                    ))\n                }\n            }\n            if !input.is_empty() {\n                input.parse::<Token![,]>()?;\n            }\n        }\n\n        Ok(Self {\n            name: name.ok_or_else(|| Error::new(input.span(), \"missing `name`\"))?,\n            system: system.ok_or_else(|| Error::new(input.span(), \"missing `system`\"))?,\n            fields,\n        })\n    }\n}\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/block/buzz/blob/eed74bde2f4797714335ac10c56c0b0244c1def4/crates/buzz-datastore-tracing/src/lib.rs#L31-L67","documentation":"The catch-all branch of #[datastore_span]'s argument parser: any key other than name, system, or fields produces 'expected `name`, `system`, or `fields`' at the offending identifier's span. It fires for typos, for unknown extras (e.g. trying target = ...), and for a `fields = ...` written with an equals sign — fields is parenthesized, so after `fields` the parser expects '(' and the '=' would be parsed as the next (unknown) key. Compile-time error.","triggerScenarios":"#[datastore_span(name = \"q\", system = \"postgresql\", targets = \"x\")] (typo/extra key), or #[datastore_span(..., fields = (a))] (wrong syntax — fields must be fields(a)), both hitting the _ => branch at crates/buzz-datastore-tracing/src/lib.rs:48-53.","commonSituations":"Trying to pass tracing::instrument-style options (target, level, skip) which this macro does not accept — it fixes target=buzz_datastore and skip_all itself; muscle memory typing `fields = (...)` after name/system which do use '='.","solutions":["Remove the unsupported key — the macro only accepts name, system, fields.","If you wrote `fields = (...)`, drop the equals: `fields(...)`.","For target/skip/level behaviour: it is already baked in (target = \"buzz_datastore\", skip_all, otel fields) — do not try to override.","Check the doc comment on datastore_span for the accepted grammar before adding new arguments."],"exampleFix":"// before\n#[datastore_span(name = \"q\", system = \"postgresql\", target = \"my_target\")]\n\n// after\n#[datastore_span(name = \"q\", system = \"postgresql\")] // target is always buzz_datastore","handlingStrategy":"validation","validationCode":"// compile-time only: `cargo check` reports the unknown key's span;\n// accepted grammar: #[datastore_span(name = \"...\", system = \"postgresql\"[, fields(...)])]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["The macro hardcodes target/skip behavior — never attempt to pass tracing::instrument options through it.","fields uses parentheses, name/system use '='; internalize the asymmetry or copy a canonical example.","Keep the doc comment on datastore_span in sync when the grammar changes so IDE hints stay accurate."],"tags":["rust","proc-macro","compile-error","tracing","macro-arguments"],"backgroundTag":"invalid-macro-argument","analyzedSha":"eed74bde2f4797714335ac10c56c0b0244c1def4","analyzedAt":"2026-08-20T04:38:24.874Z","contentChangedAt":"2026-08-20T04:38:24.874Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}