{"record":{"id":"5783b6d0cab1da72","repo":"diesel-rs/diesel","slug":"unexpected-end-of-input-expected-help-the-co-5783b6","errorCode":null,"errorMessage":"unexpected end of input, expected `=`\nhelp: the correct format looks like `#[diesel({help})]`","messagePattern":"unexpected end of input, expected `=`\nhelp: the correct format looks like `#\\[diesel\\((.+?)\\)\\]`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"diesel_attribute_parser/src/util.rs","lineNumber":19,"sourceCode":"use syn::parse::{Parse, ParseStream, Peek, Result};\nuse syn::token::Eq;\nuse syn::{Ident, Type, parenthesized};\n\npub fn unknown_attribute(name: &Ident, valid: &[&str]) -> syn::Error {\n    let prefix = if valid.len() == 1 { \"\" } else { \" one of\" };\n\n    syn::Error::new(\n        name.span(),\n        format!(\n            \"unknown attribute, expected{prefix} `{}`\",\n            valid.join(\"`, `\")\n        ),\n    )\n}\n\npub fn parse_eq<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 `=`\\n\\\n                 help: the correct format looks like `#[diesel({help})]`\",\n            ),\n        ));\n    }\n\n    input.parse::<Eq>()?;\n    input.parse()\n}\n\n/// Specialized version of `parse_eq` for `syn::Type` with a customized error message for readability.\n/// This is useful because a great variety of tokens would be valid to parse as a `syn::Type`.\npub fn parse_eq_type(input: ParseStream, help: &str) -> Result<syn::Type> {\n    if input.is_empty() {\n        return Err(syn::Error::new(\n            input.span(),","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_attribute_parser/src/util.rs#L1-L37","documentation":"Raised by the `parse_eq` helper when the attribute's token stream is empty where a `key = value` pair was expected. The parser anticipated a `=` assignment but hit the end of input instead, so it reports the expected shape with a help line.","triggerScenarios":"Writing `#[diesel(sqlite_type(name))]` (key without `=` and value), or an attribute like `#[diesel(...)]` where the parser expects `key = value` but finds nothing left to parse.","commonSituations":"Omitting the `= value` part after an attribute key; forgetting to fill in a value when copying an example.","solutions":["Provide the value after the key: `key = value`","Fill in the placeholder from the help text with a concrete value","Remove the dangling key if it was not intended"],"exampleFix":"// before\n#[diesel(sqlite_type(name))]\n// after\n#[diesel(sqlite_type(name = \"text\"))]","handlingStrategy":"validation","validationCode":"// Ensure every diesel attribute key is followed by `= value`\nfor pair in attr.parse_args_with<Punctuated<Meta, Token![,]>>()? {\n    assert!(matches!(pair, Meta::NameValue(_)), \"key must have `= value`\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never write a bare key inside #[diesel(...)] — every key needs `= value`","Fill in placeholder values immediately when copying examples","Format code (rustfmt) to spot incomplete attributes"],"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"}