提交 9cd18459 编写于 作者: L ljedrz

hir: remove NodeId from VisibilityKind

上级 01cf66bb
......@@ -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)
}
......
......@@ -3115,12 +3115,11 @@ fn lower_use_tree(
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 @@ fn lower_use_tree(
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 @@ fn lower_visibility(
ParamMode::Explicit,
explicit_owner,
)),
id: lowered_id.node_id,
hir_id: lowered_id.hir_id,
}
},
......
......@@ -2096,7 +2096,7 @@ pub struct PolyTraitRef {
pub enum VisibilityKind {
Public,
Crate(CrateSugar),
Restricted { path: P<Path>, id: NodeId, hir_id: HirId },
Restricted { path: P<Path>, hir_id: HirId },
Inherited,
}
......
......@@ -748,9 +748,8 @@ fn hash_stable<W: StableHasherResult>(&self,
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册