{"record":{"id":"f3d3564344df0845","repo":"diesel-rs/diesel","slug":"unexpected-end-of-input-expected-parentheses-help-f3d356","errorCode":null,"errorMessage":"unexpected end of input, expected parentheses\nhelp: the correct format looks like `#[diesel({help})]`","messagePattern":"unexpected end of input, expected parentheses\nhelp: the correct format looks like `#\\[diesel\\((.+?)\\)\\]`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"diesel_attribute_parser/src/util.rs","lineNumber":53,"sourceCode":"    if input.is_empty() {\n        return Err(syn::Error::new(\n            input.span(),\n            format!(\n                \"unexpected end of input, expected `=`\\n\\\n                 help: the correct format looks like `#[diesel({help})]`\",\n            ),\n        ));\n    }\n\n    input.parse::<Eq>()?;\n    input\n        .parse::<Type>()\n        .map_err(|e| syn::Error::new(e.span(), \"expected type\"))\n}\n\npub fn parse_paren<T: Parse>(input: ParseStream, help: &str) -> Result<T> {\n    if input.is_empty() {\n        return Err(syn::Error::new(\n            input.span(),\n            format!(\n                \"unexpected end of input, expected parentheses\\n\\\n                 help: the correct format looks like `#[diesel({help})]`\",\n            ),\n        ));\n    }\n\n    let content;\n    parenthesized!(content in input);\n    content.parse()\n}\n\npub fn parse_paren_list<T, D>(\n    input: ParseStream,\n    help: &str,\n    sep: D,\n) -> Result<syn::punctuated::Punctuated<T, <D as Peek>::Token>>","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_attribute_parser/src/util.rs#L35-L71","documentation":"Compile-time error from the shared attribute-parser helper parse_paren, which parses a parenthesized `key = value` group (e.g. #[diesel(sql_type = \"...\")]). It is a generic guard for malformed attribute input: it fires when the token stream ends before any parenthesized content is found, i.e. the attribute was written without its `(...)` arguments. Fix: supply the parenthesized arguments in the documented format.","triggerScenarios":"Writing `#[diesel(foreign_key)]` or similar keys that require `(...)` content but leaving the parentheses empty/absent at the point of parse.","commonSituations":"Forgetting the parenthesized arguments for attributes like `foreign_key = ...` or `sqlite_type(...)`; deleting the contents during a refactor.","solutions":["Add the required parentheses and their contents","Follow the attribute format shown in the help text"],"exampleFix":"// before\n#[diesel(foreign_key)]\n// after\n#[diesel(foreign_key(other_table.some_column))]","handlingStrategy":"validation","validationCode":"let src = quote::quote! { #attr }.to_string();\nassert!(src.contains('('), \"diesel attribute key requires parenthesized arguments\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always add `( ... )` after keys like `foreign_key` when copying examples","Never delete parenthesized args during refactors without removing the key","Use IDE attribute completions"],"tags":["rust","proc-macro","diesel","syntax"],"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"}