{"record":{"id":"315f618ae56e6cd1","repo":"diesel-rs/diesel","slug":"e-the-correct-format-is-variadic-3","errorCode":null,"errorMessage":"{e}, the correct format is `#[variadic(3)]`","messagePattern":"(.+?), the correct format is `#\\[variadic\\(3\\)\\]`","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"diesel_derives/src/sql_function.rs","lineNumber":1453,"sourceCode":"                            LitBool::new(false, Span::call_site())\n                        };\n                        Ok((count, skip_zero))\n                    }\n                })\n                .map_err(|e| {\n                    syn::Error::new(\n                        e.span(),\n                        format!(\n                            \"{e}, the correct format is `#[variadic(last_arguments = 3)]` or `#[variadic(last_arguments = 3, skip_zero_argument_variant = true)]`\"\n                        ),\n                    )\n                })?;\n            Ok(AttributeSpanWrapper {\n                item: SqlFunctionAttribute::Variadic {\n                    ident: path\n                        .require_ident()\n                        .map_err(|e| {\n                            syn::Error::new(\n                                e.span(),\n                                format!(\"{e}, the correct format is `#[variadic(3)]`\"),\n                            )\n                        })?\n                        .clone(),\n                    count: count.clone(),\n                    skip_zero_arg_variant: flag,\n                },\n                attribute_span: attr.span(),\n                ident_span: path.require_ident()?.span(),\n            })\n        }\n        syn::Meta::NameValue(_) | syn::Meta::Path(_) => Ok(AttributeSpanWrapper {\n            attribute_span: attr.span(),\n            ident_span: attr.span(),\n            item: SqlFunctionAttribute::Other(attr),\n        }),\n        syn::Meta::List(_) => {","sourceCodeStart":1435,"sourceCodeEnd":1471,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_derives/src/sql_function.rs#L1435-L1471","documentation":"Error from the `#[sql_function]` macro when the variadic attribute is used in its old path form: diesel expected the attribute to be a bare path/identifier (i.e. `#[variadic(3)]` with just an integer), but `require_ident` found something else (e.g. an unexpected path segment or key). The message appends the correct positional format.","triggerScenarios":"Using `#[sql_function]` with a legacy-style `#[variadic(...)]` attribute where the content is not a plain identifier path as expected by `path.require_ident()` — e.g. `#[variadic(foo::bar)]` misparsed or a malformed path.","commonSituations":"Mixing the old positional syntax `#[variadic(3)]` with the newer keyword syntax in one attribute; copying examples from different diesel versions.","solutions":["Use the positional form exactly: `#[variadic(3)]` with a single integer literal","Or switch to the keyword form: `#[variadic(last_arguments = 3)]`","Upgrade/check diesel docs to confirm which variadic syntax your version supports"],"exampleFix":"// before\n#[variadic(some::path)]\n// after\n#[variadic(3)]","handlingStrategy":"validation","validationCode":"fn validate_variadic_positional(inner: &str) -> Result<(), String> {\n    let t = inner.trim();\n    if t.parse::<u32>().is_ok() { Ok(()) } else { Err(format!(\"positional variadic must be a bare integer: #[variadic(3)], got {}\", t)) }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a single integer literal for the positional form: #[variadic(3)]","Prefer the keyword form `last_arguments = N` which has clearer errors","Don't mix old and new syntaxes within one attribute"],"tags":["proc-macro","rust","attribute-parsing","diesel"],"backgroundTag":"invalid-argument-format","analyzedSha":"6fa6ed01b24b24248ab2a611698d0a7c6a2e9120","analyzedAt":"2026-09-07T01:50:13.074Z","contentChangedAt":"2026-09-07T01:50:13.074Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}