{"record":{"id":"7bcba8b340533f5b","repo":"diesel-rs/diesel","slug":"unexpected-end-of-input-expected-parentheses-help-7bcba8","errorCode":null,"errorMessage":"unexpected end of input, expected parentheses\nhelp: the correct format looks like `#[diesel({POSTGRES_TYPE_NOTE})]`","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/deprecated/postgres_type.rs","lineNumber":43,"sourceCode":"                lit_str.parse()?\n            })),\n            \"array_oid\" => Ok(Attr::ArrayOid(name.clone(), {\n                let lit_str = parse_eq_and_lit_str(name, input, POSTGRES_TYPE_NOTE)?;\n                lit_str.parse()?\n            })),\n            \"type_name\" => Ok(Attr::TypeName(\n                name.clone(),\n                parse_eq_and_lit_str(name, input, POSTGRES_TYPE_NOTE)?,\n            )),\n\n            _ => Err(unknown_attribute(&name, &[\"oid\", \"array_oid\", \"type_name\"])),\n        }\n    }\n}\n\npub fn parse_postgres_type(name: Ident, input: ParseStream) -> Result<PostgresType> {\n    if input.is_empty() {\n        return Err(syn::Error::new(\n            name.span(),\n            format!(\n                \"unexpected end of input, expected parentheses\\n\\\n                 help: the correct format looks like `#[diesel({POSTGRES_TYPE_NOTE})]`\"\n            ),\n        ));\n    }\n\n    let content;\n    parenthesized!(content in input);\n\n    let mut oid = None;\n    let mut array_oid = None;\n    let mut type_name = None;\n\n    for attr in Punctuated::<Attr, Comma>::parse_terminated(&content)? {\n        match attr {\n            Attr::Oid(ident, value) => oid = Some((ident, value)),","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_attribute_parser/src/deprecated/postgres_type.rs#L25-L61","documentation":"The Postgres type attribute parser ran out of tokens before it could read the parenthesized argument list. The offending input is the macro body, which ended before the required `(...)` could be parsed.","triggerScenarios":"Writing `#[diesel(postgres_type)]` without `(name = \"...\")` or similar arguments on a type in a `#[derive(SqlType)]` context.","commonSituations":"Defining custom PostgreSQL types and omitting the type name mapping, or following outdated examples.","solutions":["Add the required parentheses around the attribute arguments","Follow the documented `#[diesel(postgres_type(...))]` form","Check that the attribute was not truncated"],"exampleFix":"// before\n#[diesel(postgres_type)]\npub struct MyType;\n// after\n#[diesel(postgres_type(name = \"my_type\"))]\npub struct MyType;","handlingStrategy":"validation","validationCode":"// compile-time: #[diesel(postgres_type(name = \"my_type\"))]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include parentheses and arguments on postgres_type","Follow current diesel custom-type docs"],"tags":["rust","proc-macro","diesel-derive","attribute-syntax","postgres"],"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"}