1
Fork 0

Store a LocalDefId in hir::Variant & hir::Field.

This commit is contained in:
Camille GILLOT 2022-11-06 19:46:55 +00:00
parent 607d0c2a14
commit 9d20aca983
25 changed files with 122 additions and 149 deletions

View file

@ -307,8 +307,8 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
}
fn visit_variant(&mut self, v: &'hir Variant<'hir>) {
self.insert(v.span, v.id, Node::Variant(v));
self.with_parent(v.id, |this| {
self.insert(v.span, v.hir_id, Node::Variant(v));
self.with_parent(v.hir_id, |this| {
// Register the constructor of this variant.
if let Some(ctor_hir_id) = v.data.ctor_hir_id() {
this.insert(v.span, ctor_hir_id, Node::Ctor(&v.data));