{"record":{"id":"7686a417539cb4d5","repo":"rwf2/Rocket","slug":"empty","errorCode":"Empty","errorMessage":"parameters cannot be empty","messagePattern":"parameters cannot be empty","errorType":"validation","errorClass":"rocket_codegen::param::Error","httpStatus":null,"severity":"error","filePath":"core/codegen/src/attribute/param/parse.rs","lineNumber":61,"sourceCode":"impl Parameter {\n    pub fn parse<P: Part>(\n        segment: &str,\n        source_span: Span,\n    ) -> Result<Self, Error<'_>>  {\n        let mut trailing = false;\n\n        // Check if this is a dynamic param. If so, check its well-formedness.\n        let lint = Lint::SegmentChars;\n        if segment.starts_with('<') && segment.ends_with('>') {\n            let mut name = &segment[1..(segment.len() - 1)];\n            if name.ends_with(\"..\") {\n                trailing = true;\n                name = &name[..(name.len() - 2)];\n            }\n\n            let span = subspan(name, segment, source_span);\n            if name.is_empty() {\n                return Err(Error::new(name, source_span, ErrorKind::Empty));\n            } else if !is_valid_ident(name) {\n                return Err(Error::new(name, span, ErrorKind::BadIdent));\n            }\n\n            let dynamic = Dynamic { name: Name::new(name, span), trailing, index: 0 };\n            if dynamic.is_wild() && P::KIND != Kind::Path {\n                return Err(Error::new(name, span, ErrorKind::Ignored));\n            } else if dynamic.is_wild() {\n                return Ok(Parameter::Ignored(dynamic));\n            } else {\n                return Ok(Parameter::Dynamic(dynamic));\n            }\n        } else if segment.is_empty() {\n            return Err(Error::new(segment, source_span, ErrorKind::Empty));\n        } else if segment.starts_with('<') && lint.enabled(source_span) {\n            let candidate = candidate_from_malformed(segment);\n            source_span.warning(\"`segment` starts with `<` but does not end with `>`\")\n                .help(format!(\"perhaps you meant the dynamic parameter `<{}>`?\", candidate))","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/rwf2/Rocket/blob/3a54d079aef060a8f732bd04ea54b0581a604087/core/codegen/src/attribute/param/parse.rs#L43-L79","documentation":"Compile-time error from Rocket's route parameter parser: a dynamic segment <...> was supplied but the name inside the brackets (after stripping a trailing ..) is empty. Both <> and <..> (trailing wildcard with no name) hit the ErrorKind::Empty branch at the top of the dynamic-param parsing in Parameter::parse. Rocket requires every dynamic parameter, including trailing ones, to have a valid name.","triggerScenarios":"#[get(\"/<>\")] — empty dynamic segment; #[get(\"/<..>\")] — unnamed trailing parameter; the same patterns inside query segments like /path?<>.","commonSituations":"Trying to express 'match anything here' with <> or copying a wildcard style from other frameworks; refactoring a path and accidentally deleting the parameter name but leaving the brackets.","solutions":["Give the parameter a name: #[get(\"/<id..>\")] instead of #[get(\"/<..>\")]","For an intentionally ignored catch-all path segment use the named wildcard underscore only where allowed: <rest..> with a matching &rest Path argument, or <_..> only in path position","For a plain static route, remove the angle brackets entirely"],"exampleFix":"// before\n#[get(\"/<..>\")]\nfn all() { }\n\n// after\n#[get(\"/<rest..>\")]\nfn all(rest: Path<String>) { }","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never leave <> or <..> in a route — every parameter needs a name","For catch-alls use <name..> with a Path<String> handler argument","Let the compiler be the validator: keep routes in checked code, not strings"],"tags":["rust","rocket","proc-macro","codegen","compile-time","route-parameter"],"backgroundTag":"empty-route-parameter","analyzedSha":"3a54d079aef060a8f732bd04ea54b0581a604087","analyzedAt":"2026-08-16T22:01:48.395Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}