1
Fork 0

GenericParam does not need to be a HIR owner.

This commit is contained in:
Camille GILLOT 2021-03-23 22:47:22 +01:00
parent d04c3aa865
commit 4c0b7ac7ba
4 changed files with 6 additions and 54 deletions

View file

@ -172,17 +172,4 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
// we are currently in. So for those it's correct that they have a
// different owner.
}
fn visit_generic_param(&mut self, param: &'hir hir::GenericParam<'hir>) {
if let hir::GenericParamKind::Type {
synthetic: Some(hir::SyntheticTyParamKind::ImplTrait),
..
} = param.kind
{
// Synthetic impl trait parameters are owned by the node of the desugared type.
// This means it is correct for them to have a different owner.
} else {
intravisit::walk_generic_param(self, param);
}
}
}