{"record":{"id":"f8c5768956b0a7f5","repo":"rwf2/Rocket","slug":"notrailing","errorCode":"NoTrailing","errorMessage":"parameter cannot be trailing","messagePattern":"parameter cannot be trailing","errorType":"validation","errorClass":"rocket_codegen::param::Error","httpStatus":null,"severity":"error","filePath":"core/codegen/src/attribute/param/parse.rs","lineNumber":193,"sourceCode":"            ErrorKind::Static => {\n                let candidate = candidate_from_malformed(error.segment);\n                error.span.error(error.kind.to_string())\n                    .help(format!(\"parameter must be dynamic: `<{}>`\", candidate))\n            }\n        }\n    }\n}\n\nimpl devise::FromMeta for Dynamic {\n    fn from_meta(meta: &devise::MetaItem) -> devise::Result<Self> {\n        let string = StringLit::from_meta(meta)?;\n        let span = string.subspan(1..string.len() + 1);\n        let param = Dynamic::parse::<Path>(&string, span)?;\n\n        if param.is_wild() {\n            return Err(Error::new(&string, span, ErrorKind::Ignored).into());\n        } else if param.trailing {\n            return Err(Error::new(&string, span, ErrorKind::NoTrailing).into());\n        } else {\n            Ok(param)\n        }\n    }\n}\n\nfn subspan(needle: &str, haystack: &str, span: Span) -> Span {\n    let index = needle.as_ptr() as usize - haystack.as_ptr() as usize;\n    StringLit::new(haystack, span).subspan(index..index + needle.len())\n}\n\nfn trailspan(needle: &str, haystack: &str, span: Span) -> Span {\n    let index = needle.as_ptr() as usize - haystack.as_ptr() as usize;\n    let lit = StringLit::new(haystack, span);\n    if needle.as_ptr() as usize > haystack.as_ptr() as usize {\n        lit.subspan((index - 1)..)\n    } else {\n        lit.subspan(index..)","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/rwf2/Rocket/blob/3a54d079aef060a8f732bd04ea54b0581a604087/core/codegen/src/attribute/param/parse.rs#L175-L211","documentation":"Compile-time error from the FromMeta impl for Dynamic (parse.rs:184): the attribute value parsed as a Path-kind dynamic parameter has trailing = true (a <name..> form), but this attribute context does not accept trailing parameters, so it is rejected with ErrorKind::NoTrailing ('parameter cannot be trailing'). Trailing syntax is only meaningful inside route origin strings, not in single-parameter attribute values like data =.","triggerScenarios":"#[post(\"/upload\", data = \"<file..>\")] — trailing marker on a data binding; any FromMeta-parsed Dynamic value containing the .. suffix.","commonSituations":"Copying a catch-all path segment (<path..>) into the data = slot; misunderstanding that data = binds a single stream, not multiple segments.","solutions":["Remove the trailing dots: data = \"<file..>\" → data = \"<file>\"","Keep <name..> syntax only inside the route path string itself"],"exampleFix":"// before\n#[post(\"/upload\", data = \"<file..>\")]\nfn upload(file: TempFile<'_>) { }\n\n// after\n#[post(\"/upload\", data = \"<file>\")]\nfn upload(file: TempFile<'_>) { }","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve the .. suffix exclusively for route path catch-alls","data = binds a single stream; no trailing syntax there","cargo check catches this instantly"],"tags":["rust","rocket","proc-macro","codegen","compile-time","trailing-parameter","route-attribute"],"backgroundTag":"trailing-parameter-misuse","analyzedSha":"3a54d079aef060a8f732bd04ea54b0581a604087","analyzedAt":"2026-08-16T22:01:48.395Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}