diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2020-02-08 04:24:42 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2020-03-14 22:52:29 +0100 |
| commit | d99b17fa6478e1c7d55c95938e90467ae0e2ab2c (patch) | |
| tree | 3d4c0261cf18962ef082051d9c7184d6483f5afd | |
| parent | 072449c0dc9bd435f002fa7fb531d6819033229e (diff) | |
| download | rust-d99b17fa6478e1c7d55c95938e90467ae0e2ab2c.tar.gz rust-d99b17fa6478e1c7d55c95938e90467ae0e2ab2c.zip | |
Remove the `map` field from `Map`
| -rw-r--r-- | src/librustc/hir/map/mod.rs | 25 | ||||
| -rw-r--r-- | src/librustc/hir/mod.rs | 2 |
2 files changed, 0 insertions, 27 deletions
diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs index 1a816e6b2cb..7604aeb8766 100644 --- a/src/librustc/hir/map/mod.rs +++ b/src/librustc/hir/map/mod.rs @@ -172,8 +172,6 @@ pub struct Map<'hir> { pub(super) owner_map: FxHashMap<DefIndex, &'hir HirOwner<'hir>>, pub(super) owner_items_map: FxHashMap<DefIndex, &'hir HirOwnerItems<'hir>>, - pub(super) map: HirEntryMap<'hir>, - pub(super) definitions: &'hir Definitions, /// The reverse mapping of `node_to_hir_id`. @@ -221,27 +219,6 @@ impl<'hir> Map<'hir> { } #[inline] - fn lookup(&self, id: HirId) -> Option<&Entry<'hir>> { - let local_map = self.map.get(id.owner)?; - local_map.get(id.local_id)?.as_ref() - } - - /// Registers a read in the dependency graph of the AST node with - /// the given `id`. This needs to be called each time a public - /// function returns the HIR for a node -- in other words, when it - /// "reveals" the content of a node to the caller (who might not - /// otherwise have had access to those contents, and hence needs a - /// read recorded). If the function just returns a DefId or - /// HirId, no actual content was returned, so no read is needed. - pub fn read(&self, hir_id: HirId) { - if let Some(entry) = self.lookup(hir_id) { - self.dep_graph.read_index(entry.dep_node); - } else { - bug!("called `HirMap::read()` with invalid `HirId`: {:?}", hir_id) - } - } - - #[inline] pub fn definitions(&self) -> &Definitions { &self.definitions } @@ -943,7 +920,6 @@ impl<'hir> Map<'hir> { /// Given a node ID, gets a list of attributes associated with the AST /// corresponding to the node-ID. pub fn attrs(&self, id: HirId) -> &'hir [ast::Attribute] { - self.read(id); // reveals attributes on the node let attrs = match self.find_entry(id).map(|entry| entry.node) { Some(Node::Param(a)) => Some(&a.attrs[..]), Some(Node::Local(l)) => Some(&l.attrs[..]), @@ -967,7 +943,6 @@ impl<'hir> Map<'hir> { } pub fn span(&self, hir_id: HirId) -> Span { - self.read(hir_id); // reveals span from node match self.find_entry(hir_id).map(|entry| entry.node) { Some(Node::Param(param)) => param.span, Some(Node::Item(item)) => item.span, diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index f113efa6300..34cfff999a7 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -107,8 +107,6 @@ pub fn provide(providers: &mut Providers<'_>) { owner_map: early.owner_map, owner_items_map: early.owner_items_map, - map: early.map, - definitions: early.definitions, hir_to_node_id: early.hir_to_node_id, |
