{"record":{"id":"d318d4b9cbd456b1","repo":"rwf2/Rocket","slug":"ignored","errorCode":"Ignored","errorMessage":"parameter must be named","messagePattern":"parameter must be named","errorType":"validation","errorClass":"rocket_codegen::param::Error","httpStatus":null,"severity":"error","filePath":"core/codegen/src/attribute/param/parse.rs","lineNumber":68,"sourceCode":"        // 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))\n                .note(lint.how_to_suppress())\n                .emit_as_item_tokens();\n        } else if (segment.contains('>') || segment.contains('<')) && lint.enabled(source_span) {\n            source_span.warning(\"`segment` contains `<` or `>` but is not a dynamic parameter\")\n                .emit_as_item_tokens();\n        }\n","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/rwf2/Rocket/blob/3a54d079aef060a8f732bd04ea54b0581a604087/core/codegen/src/attribute/param/parse.rs#L50-L86","documentation":"Compile-time error from Rocket's codegen: the wildcard parameter <_> was used in a segment kind that does not allow ignored parameters. Only Path-kind segments (P::KIND == Kind::Path) accept the ignored wildcard; using <_> or <_..> in a query segment (or any non-Path Part) is rejected with ErrorKind::Ignored ('parameter must be named'). Query parameters must always be named because the name is the query key.","triggerScenarios":"#[get(\"/hello?<_..>\")] — trying to ignore trailing query params; #[get(\"/hello?<_>\")] — ignoring a single query param; the same inside FromMeta contexts that parse with fmt::Query (e.g. cookie/flash attribute values).","commonSituations":"Wanting to accept-and-ignore extra query parameters while only forwarding some; copying the path wildcard style <_> (valid in paths, e.g. /hello/<_>) into the ?query part of the route.","solutions":["Name the query parameter and bind it in the handler: #[get(\"/hello?<_rest..>\")] → #[get(\"/hello?<id>\")]","To ignore extra query params, simply omit them — unbound query keys are ignored by default; bind only the keys you need","Remember <_> is only legal in path position: /hello/<_> is fine, /hello?<_> is not"],"exampleFix":"// before\n#[get(\"/search?<_..>\")]\nfn search() { }\n\n// after\n#[get(\"/search?<q>\")]\nfn search(q: &str) { }","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember <_> is legal only in path segments, never in ?query segments","Unbound query keys are ignored by default — bind only the ones you need, by name","Use <rest..> style named trailing params in queries"],"tags":["rust","rocket","proc-macro","codegen","compile-time","query-parameters","wildcard"],"backgroundTag":"wildcard-parameter-misuse","analyzedSha":"3a54d079aef060a8f732bd04ea54b0581a604087","analyzedAt":"2026-08-16T22:01:48.395Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}