diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs index 62f0602e1fa..a24ecf938ba 100644 --- a/compiler/rustc_parse/src/parser/ty.rs +++ b/compiler/rustc_parse/src/parser/ty.rs @@ -694,7 +694,13 @@ fn parse_precise_capturing_args(&mut self) -> PResult<'a, ThinVec visit::walk_precise_capturing_arg(self, arg), - PreciseCapturingArg::Arg(ident, _) => { - todo!("cannot resolve args yet: {ident}"); + PreciseCapturingArg::Arg(ident, node_id) => { + let ident = ident.normalize_to_macros_2_0(); + 'found: { + for (rib_t, rib_v) in + std::iter::zip(&self.ribs.type_ns, &self.ribs.value_ns).rev() + { + if let Some(res) = rib_t.bindings.get(&ident).or(rib_v.bindings.get(&ident)) + { + self.r.record_partial_res(*node_id, PartialRes::new(*res)); + break 'found; + } + } + self.report_error( + ident.span, + ResolutionError::FailedToResolve { + segment: Some(ident.name), + label: "could not find type or const parameter".to_string(), + suggestion: None, + module: None, + }, + ); + } } } }