Skip to content

Commit 4c51991

Browse files
committed
Remove the map field from Map
1 parent b4b03ef commit 4c51991

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

src/librustc/hir/map/mod.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ pub struct Map<'hir> {
172172
pub(super) owner_map: FxHashMap<DefIndex, &'hir HirOwner<'hir>>,
173173
pub(super) owner_items_map: FxHashMap<DefIndex, &'hir HirOwnerItems<'hir>>,
174174

175-
pub(super) map: HirEntryMap<'hir>,
176-
177175
pub(super) definitions: &'hir Definitions,
178176

179177
/// The reverse mapping of `node_to_hir_id`.
@@ -224,27 +222,6 @@ impl<'hir> Map<'hir> {
224222
&self.krate
225223
}
226224

227-
#[inline]
228-
fn lookup(&self, id: HirId) -> Option<&Entry<'hir>> {
229-
let local_map = self.map.get(id.owner)?;
230-
local_map.get(id.local_id)?.as_ref()
231-
}
232-
233-
/// Registers a read in the dependency graph of the AST node with
234-
/// the given `id`. This needs to be called each time a public
235-
/// function returns the HIR for a node -- in other words, when it
236-
/// "reveals" the content of a node to the caller (who might not
237-
/// otherwise have had access to those contents, and hence needs a
238-
/// read recorded). If the function just returns a DefId or
239-
/// HirId, no actual content was returned, so no read is needed.
240-
pub fn read(&self, hir_id: HirId) {
241-
if let Some(entry) = self.lookup(hir_id) {
242-
self.dep_graph.read_index(entry.dep_node);
243-
} else {
244-
bug!("called `HirMap::read()` with invalid `HirId`: {:?}", hir_id)
245-
}
246-
}
247-
248225
#[inline]
249226
pub fn definitions(&self) -> &Definitions {
250227
&self.definitions
@@ -948,7 +925,6 @@ impl<'hir> Map<'hir> {
948925
/// Given a node ID, gets a list of attributes associated with the AST
949926
/// corresponding to the node-ID.
950927
pub fn attrs(&self, id: HirId) -> &'hir [ast::Attribute] {
951-
self.read(id); // reveals attributes on the node
952928
let attrs = match self.find_entry(id).map(|entry| entry.node) {
953929
Some(Node::Param(a)) => Some(&a.attrs[..]),
954930
Some(Node::Local(l)) => Some(&l.attrs[..]),
@@ -972,7 +948,6 @@ impl<'hir> Map<'hir> {
972948
}
973949

974950
pub fn span(&self, hir_id: HirId) -> Span {
975-
self.read(hir_id); // reveals span from node
976951
match self.find_entry(hir_id).map(|entry| entry.node) {
977952
Some(Node::Param(param)) => param.span,
978953
Some(Node::Item(item)) => item.span,

src/librustc/hir/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ pub fn provide(providers: &mut Providers<'_>) {
100100
owner_map: early.owner_map,
101101
owner_items_map: early.owner_items_map,
102102

103-
map: early.map,
104-
105103
definitions: early.definitions,
106104

107105
hir_to_node_id: early.hir_to_node_id,

0 commit comments

Comments
 (0)