{"record":{"id":"8ddbf85ddee9c72c","repo":"rust-lang/rust","slug":"no-partial-res-expected-for-precise-capture-arg","errorCode":null,"errorMessage":"no partial res expected for precise capture arg","messagePattern":"no partial res expected for precise capture arg","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/rustc_ast_lowering/src/lib.rs","lineNumber":1908,"sourceCode":"        let opaque_ty_def = self.arena.alloc(opaque_ty_def);\n\n        hir::TyKind::OpaqueDef(opaque_ty_def)\n    }\n\n    fn lower_precise_capturing_args(\n        &mut self,\n        precise_capturing_args: &[PreciseCapturingArg],\n    ) -> &'hir [hir::PreciseCapturingArg<'hir>] {\n        self.arena.alloc_from_iter(precise_capturing_args.iter().map(|arg| match arg {\n            PreciseCapturingArg::Lifetime(lt) => hir::PreciseCapturingArg::Lifetime(\n                self.lower_lifetime(lt, LifetimeSource::PreciseCapturing, lt.ident.into()),\n            ),\n            PreciseCapturingArg::Arg(path, id) => {\n                let [segment] = path.segments.as_slice() else {\n                    panic!();\n                };\n                let res = self.get_partial_res(*id).map_or(Res::Err, |partial_res| {\n                    partial_res.full_res().expect(\"no partial res expected for precise capture arg\")\n                });\n                hir::PreciseCapturingArg::Param(hir::PreciseCapturingNonLifetimeArg {\n                    hir_id: self.lower_node_id(*id),\n                    ident: self.lower_ident(segment.ident),\n                    res: self.lower_res(res),\n                })\n            }\n        }))\n    }\n\n    fn lower_fn_params_to_idents(&mut self, decl: &FnDecl) -> &'hir [Option<Ident>] {\n        self.arena.alloc_from_iter(decl.inputs.iter().map(|param| match param.pat.kind {\n            PatKind::Missing => None,\n            PatKind::Ident(_, ident, _) => Some(self.lower_ident(ident)),\n            PatKind::Wild => Some(Ident::new(kw::Underscore, self.lower_span(param.pat.span))),\n            _ => {\n                self.dcx().span_delayed_bug(\n                    param.pat.span,","sourceCodeStart":1890,"sourceCodeEnd":1926,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/compiler/rustc_ast_lowering/src/lib.rs#L1890-L1926","documentation":"lib.rs:1908: lower_precise_capturing_args handles `use<'a, T>` precise-capture lists. For a non-lifetime arg it calls partial_res.full_res().expect(\"no partial res expected for precise capture arg\"). The invariant: name resolution must have produced a partial resolution whose full_res() is Some for every precise-capture arg.","triggerScenarios":"A precise-capturing use clause (`impl Trait + use<T>`) where the resolver did not produce a full resolution for an argument; a resolver/lowering mismatch.","commonSituations":"Nightly code using precise-capturing syntax with an unresolved or malformed capture argument; a compiler bug in resolution of precise-capture args.","solutions":["File a rustc ICE with the minimized `use<...>` repro.","Ensure every precise-capture argument is a resolvable type/lifetime in scope.","Simplify the capture list (fewer args) to isolate the offending one.","Bisect with cargo bisect-rustc."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure every precise-capture argument in `use<...>` is a resolvable type/lifetime in scope.","Keep precise-capture lists small and well-named to ease minimization.","File a rustc ICE with the minimized `use<...>` repro.","Bisect with cargo bisect-rustc across nightlies."],"tags":["rust","precise-capturing","compiler-internal","ice"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}