Skip to content

Commit 9cd1845

Browse files
committed
hir: remove NodeId from VisibilityKind
1 parent 01cf66b commit 9cd1845

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

src/librustc/hir/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ pub fn walk_arm<'v, V: Visitor<'v>>(visitor: &mut V, arm: &'v Arm) {
11051105
}
11061106

11071107
pub fn walk_vis<'v, V: Visitor<'v>>(visitor: &mut V, vis: &'v Visibility) {
1108-
if let VisibilityKind::Restricted { ref path, id: _, hir_id } = vis.node {
1108+
if let VisibilityKind::Restricted { ref path, hir_id } = vis.node {
11091109
visitor.visit_id(hir_id);
11101110
visitor.visit_path(path, hir_id)
11111111
}

src/librustc/hir/lowering.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -3115,12 +3115,11 @@ impl<'a> LoweringContext<'a> {
31153115
hir::VisibilityKind::Public => hir::VisibilityKind::Public,
31163116
hir::VisibilityKind::Crate(sugar) => hir::VisibilityKind::Crate(sugar),
31173117
hir::VisibilityKind::Inherited => hir::VisibilityKind::Inherited,
3118-
hir::VisibilityKind::Restricted { ref path, id: _, hir_id: _ } => {
3118+
hir::VisibilityKind::Restricted { ref path, hir_id: _ } => {
31193119
let id = this.next_id();
31203120
let path = this.renumber_segment_ids(path);
31213121
hir::VisibilityKind::Restricted {
31223122
path,
3123-
id: id.node_id,
31243123
hir_id: id.hir_id,
31253124
}
31263125
}
@@ -3222,12 +3221,11 @@ impl<'a> LoweringContext<'a> {
32223221
hir::VisibilityKind::Public => hir::VisibilityKind::Public,
32233222
hir::VisibilityKind::Crate(sugar) => hir::VisibilityKind::Crate(sugar),
32243223
hir::VisibilityKind::Inherited => hir::VisibilityKind::Inherited,
3225-
hir::VisibilityKind::Restricted { ref path, id: _, hir_id: _ } => {
3224+
hir::VisibilityKind::Restricted { ref path, hir_id: _ } => {
32263225
let id = this.next_id();
32273226
let path = this.renumber_segment_ids(path);
32283227
hir::VisibilityKind::Restricted {
32293228
path: path,
3230-
id: id.node_id,
32313229
hir_id: id.hir_id,
32323230
}
32333231
}
@@ -4721,7 +4719,6 @@ impl<'a> LoweringContext<'a> {
47214719
ParamMode::Explicit,
47224720
explicit_owner,
47234721
)),
4724-
id: lowered_id.node_id,
47254722
hir_id: lowered_id.hir_id,
47264723
}
47274724
},

src/librustc/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2096,7 +2096,7 @@ pub type Visibility = Spanned<VisibilityKind>;
20962096
pub enum VisibilityKind {
20972097
Public,
20982098
Crate(CrateSugar),
2099-
Restricted { path: P<Path>, id: NodeId, hir_id: HirId },
2099+
Restricted { path: P<Path>, hir_id: HirId },
21002100
Inherited,
21012101
}
21022102

src/librustc/ich/impls_hir.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -748,9 +748,8 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::VisibilityKind {
748748
hir::VisibilityKind::Crate(sugar) => {
749749
sugar.hash_stable(hcx, hasher);
750750
}
751-
hir::VisibilityKind::Restricted { ref path, id, hir_id } => {
751+
hir::VisibilityKind::Restricted { ref path, hir_id } => {
752752
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
753-
id.hash_stable(hcx, hasher);
754753
hir_id.hash_stable(hcx, hasher);
755754
});
756755
path.hash_stable(hcx, hasher);

0 commit comments

Comments
 (0)