Add hir::Node::PreciseCapturingNonLifetimeArg
This commit is contained in:
parent
42ba57c013
commit
02d7317af2
14 changed files with 110 additions and 38 deletions
|
@ -487,7 +487,9 @@ fn check_opaque_precise_captures<'tcx>(tcx: TyCtxt<'tcx>, opaque_def_id: LocalDe
|
|||
for arg in precise_capturing_args {
|
||||
match *arg {
|
||||
hir::PreciseCapturingArg::Lifetime(&hir::Lifetime { hir_id, .. })
|
||||
| hir::PreciseCapturingArg::Param(_, hir_id) => match tcx.named_bound_var(hir_id) {
|
||||
| hir::PreciseCapturingArg::Param(hir::PreciseCapturingNonLifetimeArg {
|
||||
hir_id, ..
|
||||
}) => match tcx.named_bound_var(hir_id) {
|
||||
Some(ResolvedArg::EarlyBound(def_id)) => {
|
||||
expected_captures.insert(def_id);
|
||||
}
|
||||
|
|
|
@ -577,10 +577,10 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
|
|||
});
|
||||
}
|
||||
},
|
||||
hir::PreciseCapturingArg::Param(res, hir_id) => match res {
|
||||
hir::PreciseCapturingArg::Param(param) => match param.res {
|
||||
Res::Def(DefKind::TyParam | DefKind::ConstParam, def_id)
|
||||
| Res::SelfTyParam { trait_: def_id } => {
|
||||
self.resolve_type_ref(def_id.expect_local(), hir_id);
|
||||
self.resolve_type_ref(def_id.expect_local(), param.hir_id);
|
||||
}
|
||||
Res::Err => {}
|
||||
_ => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue