Add hir::Node::PreciseCapturingNonLifetimeArg

This commit is contained in:
Michael Goulet
2024-04-04 14:46:26 -04:00
parent 42ba57c013
commit 02d7317af2
14 changed files with 110 additions and 38 deletions

View File

@@ -1790,11 +1790,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
PreciseCapturingArg::Lifetime(lt) => {
hir::PreciseCapturingArg::Lifetime(self.lower_lifetime(lt))
}
PreciseCapturingArg::Arg(_, node_id) => {
PreciseCapturingArg::Arg(ident, node_id) => {
let res = self.resolver.get_partial_res(*node_id).map_or(Res::Err, |partial_res| {
partial_res.full_res().expect("no partial res expected for precise capture arg")
});
hir::PreciseCapturingArg::Param(self.lower_res(res), self.lower_node_id(*node_id))
hir::PreciseCapturingArg::Param(hir::PreciseCapturingNonLifetimeArg {
hir_id: self.lower_node_id(*node_id),
ident: self.lower_ident(*ident),
res: self.lower_res(res),
})
}
}))
}