Skip to content

Commit a1a338f

Browse files
committed
Rename MapEntry to EntryKind
1 parent 70a21e8 commit a1a338f

File tree

2 files changed

+159
-161
lines changed

2 files changed

+159
-161
lines changed

src/librustc/hir/map/collector.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub(super) struct NodeCollector<'a, 'hir> {
2929
/// The crate
3030
krate: &'hir Crate,
3131
/// The node map
32-
map: Vec<MapEntry<'hir>>,
32+
map: Vec<EntryKind<'hir>>,
3333
/// The parent of this node
3434
parent_node: NodeId,
3535

@@ -114,7 +114,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
114114
hcx,
115115
hir_body_nodes,
116116
};
117-
collector.insert_entry(CRATE_NODE_ID, RootCrate(root_mod_sig_dep_index));
117+
collector.insert_entry(CRATE_NODE_ID, EntryKind::RootCrate(root_mod_sig_dep_index));
118118

119119
collector
120120
}
@@ -124,7 +124,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
124124
cstore: &dyn CrateStore,
125125
source_map: &SourceMap,
126126
commandline_args_hash: u64)
127-
-> (Vec<MapEntry<'hir>>, Svh) {
127+
-> (Vec<EntryKind<'hir>>, Svh) {
128128
self
129129
.hir_body_nodes
130130
.sort_unstable_by(|&(ref d1, _), &(ref d2, _)| d1.cmp(d2));
@@ -178,11 +178,11 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
178178
(self.map, svh)
179179
}
180180

181-
fn insert_entry(&mut self, id: NodeId, entry: MapEntry<'hir>) {
181+
fn insert_entry(&mut self, id: NodeId, entry: EntryKind<'hir>) {
182182
debug!("hir_map: {:?} => {:?}", id, entry);
183183
let len = self.map.len();
184184
if id.as_usize() >= len {
185-
self.map.extend(repeat(NotPresent).take(id.as_usize() - len + 1));
185+
self.map.extend(repeat(EntryKind::NotPresent).take(id.as_usize() - len + 1));
186186
}
187187
self.map[id.as_usize()] = entry;
188188
}
@@ -196,26 +196,26 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
196196
};
197197

198198
let entry = match node {
199-
NodeItem(n) => EntryItem(parent, dep_node_index, n),
200-
NodeForeignItem(n) => EntryForeignItem(parent, dep_node_index, n),
201-
NodeTraitItem(n) => EntryTraitItem(parent, dep_node_index, n),
202-
NodeImplItem(n) => EntryImplItem(parent, dep_node_index, n),
203-
NodeVariant(n) => EntryVariant(parent, dep_node_index, n),
204-
NodeField(n) => EntryField(parent, dep_node_index, n),
205-
NodeAnonConst(n) => EntryAnonConst(parent, dep_node_index, n),
206-
NodeExpr(n) => EntryExpr(parent, dep_node_index, n),
207-
NodeStmt(n) => EntryStmt(parent, dep_node_index, n),
208-
NodeTy(n) => EntryTy(parent, dep_node_index, n),
209-
NodeTraitRef(n) => EntryTraitRef(parent, dep_node_index, n),
210-
NodeBinding(n) => EntryBinding(parent, dep_node_index, n),
211-
NodePat(n) => EntryPat(parent, dep_node_index, n),
212-
NodeBlock(n) => EntryBlock(parent, dep_node_index, n),
213-
NodeStructCtor(n) => EntryStructCtor(parent, dep_node_index, n),
214-
NodeLifetime(n) => EntryLifetime(parent, dep_node_index, n),
215-
NodeGenericParam(n) => EntryGenericParam(parent, dep_node_index, n),
216-
NodeVisibility(n) => EntryVisibility(parent, dep_node_index, n),
217-
NodeLocal(n) => EntryLocal(parent, dep_node_index, n),
218-
NodeMacroDef(n) => EntryMacroDef(dep_node_index, n),
199+
NodeItem(n) => EntryKind::Item(parent, dep_node_index, n),
200+
NodeForeignItem(n) => EntryKind::ForeignItem(parent, dep_node_index, n),
201+
NodeTraitItem(n) => EntryKind::TraitItem(parent, dep_node_index, n),
202+
NodeImplItem(n) => EntryKind::ImplItem(parent, dep_node_index, n),
203+
NodeVariant(n) => EntryKind::Variant(parent, dep_node_index, n),
204+
NodeField(n) => EntryKind::Field(parent, dep_node_index, n),
205+
NodeAnonConst(n) => EntryKind::AnonConst(parent, dep_node_index, n),
206+
NodeExpr(n) => EntryKind::Expr(parent, dep_node_index, n),
207+
NodeStmt(n) => EntryKind::Stmt(parent, dep_node_index, n),
208+
NodeTy(n) => EntryKind::Ty(parent, dep_node_index, n),
209+
NodeTraitRef(n) => EntryKind::TraitRef(parent, dep_node_index, n),
210+
NodeBinding(n) => EntryKind::Binding(parent, dep_node_index, n),
211+
NodePat(n) => EntryKind::Pat(parent, dep_node_index, n),
212+
NodeBlock(n) => EntryKind::Block(parent, dep_node_index, n),
213+
NodeStructCtor(n) => EntryKind::StructCtor(parent, dep_node_index, n),
214+
NodeLifetime(n) => EntryKind::Lifetime(parent, dep_node_index, n),
215+
NodeGenericParam(n) => EntryKind::GenericParam(parent, dep_node_index, n),
216+
NodeVisibility(n) => EntryKind::Visibility(parent, dep_node_index, n),
217+
NodeLocal(n) => EntryKind::Local(parent, dep_node_index, n),
218+
NodeMacroDef(n) => EntryKind::MacroDef(dep_node_index, n),
219219
};
220220

221221
// Make sure that the DepNode of some node coincides with the HirId

0 commit comments

Comments
 (0)