From 9cd184590847ae20f3e49c3f23d8118632011872 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 26 Feb 2019 15:55:01 +0100 Subject: [PATCH] hir: remove NodeId from VisibilityKind --- src/librustc/hir/intravisit.rs | 2 +- src/librustc/hir/lowering.rs | 7 ++----- src/librustc/hir/mod.rs | 2 +- src/librustc/ich/impls_hir.rs | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index 85549bc667f9d..0aeac8cc440ec 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -1105,7 +1105,7 @@ pub fn walk_arm<'v, V: Visitor<'v>>(visitor: &mut V, arm: &'v Arm) { } pub fn walk_vis<'v, V: Visitor<'v>>(visitor: &mut V, vis: &'v Visibility) { - if let VisibilityKind::Restricted { ref path, id: _, hir_id } = vis.node { + if let VisibilityKind::Restricted { ref path, hir_id } = vis.node { visitor.visit_id(hir_id); visitor.visit_path(path, hir_id) } diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 738c7d770353b..a97ea7da7f19c 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -3115,12 +3115,11 @@ impl<'a> LoweringContext<'a> { hir::VisibilityKind::Public => hir::VisibilityKind::Public, hir::VisibilityKind::Crate(sugar) => hir::VisibilityKind::Crate(sugar), hir::VisibilityKind::Inherited => hir::VisibilityKind::Inherited, - hir::VisibilityKind::Restricted { ref path, id: _, hir_id: _ } => { + hir::VisibilityKind::Restricted { ref path, hir_id: _ } => { let id = this.next_id(); let path = this.renumber_segment_ids(path); hir::VisibilityKind::Restricted { path, - id: id.node_id, hir_id: id.hir_id, } } @@ -3222,12 +3221,11 @@ impl<'a> LoweringContext<'a> { hir::VisibilityKind::Public => hir::VisibilityKind::Public, hir::VisibilityKind::Crate(sugar) => hir::VisibilityKind::Crate(sugar), hir::VisibilityKind::Inherited => hir::VisibilityKind::Inherited, - hir::VisibilityKind::Restricted { ref path, id: _, hir_id: _ } => { + hir::VisibilityKind::Restricted { ref path, hir_id: _ } => { let id = this.next_id(); let path = this.renumber_segment_ids(path); hir::VisibilityKind::Restricted { path: path, - id: id.node_id, hir_id: id.hir_id, } } @@ -4721,7 +4719,6 @@ impl<'a> LoweringContext<'a> { ParamMode::Explicit, explicit_owner, )), - id: lowered_id.node_id, hir_id: lowered_id.hir_id, } }, diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 3a2a1f3f3dd04..3ba4efba9186c 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -2096,7 +2096,7 @@ pub type Visibility = Spanned; pub enum VisibilityKind { Public, Crate(CrateSugar), - Restricted { path: P, id: NodeId, hir_id: HirId }, + Restricted { path: P, hir_id: HirId }, Inherited, } diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index 1bfb036495b57..af1cce5e35454 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -748,9 +748,8 @@ impl<'a> HashStable> for hir::VisibilityKind { hir::VisibilityKind::Crate(sugar) => { sugar.hash_stable(hcx, hasher); } - hir::VisibilityKind::Restricted { ref path, id, hir_id } => { + hir::VisibilityKind::Restricted { ref path, hir_id } => { hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| { - id.hash_stable(hcx, hasher); hir_id.hash_stable(hcx, hasher); }); path.hash_stable(hcx, hasher);