1
Fork 0

Do not visit ForeignItemRef for HIR indexing and validation.

Similarly to what is done for ImplItemRef and TraitItemRef.

Fixes #79487
This commit is contained in:
Camille GILLOT 2020-11-28 18:08:11 +01:00
parent 4ae328bef4
commit 5bd197921a
3 changed files with 27 additions and 0 deletions

View file

@ -572,6 +572,14 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
self.visit_nested_impl_item(id);
}
fn visit_foreign_item_ref(&mut self, fi: &'hir ForeignItemRef<'hir>) {
// Do not visit the duplicate information in ForeignItemRef. We want to
// map the actual nodes, not the duplicate ones in the *Ref.
let ForeignItemRef { id, ident: _, span: _, vis: _ } = *fi;
self.visit_nested_foreign_item(id);
}
}
struct HirItemLike<T> {