@@ -172,8 +172,6 @@ pub struct Map<'hir> {
172
172
pub ( super ) owner_map : FxHashMap < DefIndex , & ' hir HirOwner < ' hir > > ,
173
173
pub ( super ) owner_items_map : FxHashMap < DefIndex , & ' hir HirOwnerItems < ' hir > > ,
174
174
175
- pub ( super ) map : HirEntryMap < ' hir > ,
176
-
177
175
pub ( super ) definitions : & ' hir Definitions ,
178
176
179
177
/// The reverse mapping of `node_to_hir_id`.
@@ -224,27 +222,6 @@ impl<'hir> Map<'hir> {
224
222
& self . krate
225
223
}
226
224
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
-
248
225
#[ inline]
249
226
pub fn definitions ( & self ) -> & Definitions {
250
227
& self . definitions
@@ -948,7 +925,6 @@ impl<'hir> Map<'hir> {
948
925
/// Given a node ID, gets a list of attributes associated with the AST
949
926
/// corresponding to the node-ID.
950
927
pub fn attrs ( & self , id : HirId ) -> & ' hir [ ast:: Attribute ] {
951
- self . read ( id) ; // reveals attributes on the node
952
928
let attrs = match self . find_entry ( id) . map ( |entry| entry. node ) {
953
929
Some ( Node :: Param ( a) ) => Some ( & a. attrs [ ..] ) ,
954
930
Some ( Node :: Local ( l) ) => Some ( & l. attrs [ ..] ) ,
@@ -972,7 +948,6 @@ impl<'hir> Map<'hir> {
972
948
}
973
949
974
950
pub fn span ( & self , hir_id : HirId ) -> Span {
975
- self . read ( hir_id) ; // reveals span from node
976
951
match self . find_entry ( hir_id) . map ( |entry| entry. node ) {
977
952
Some ( Node :: Param ( param) ) => param. span ,
978
953
Some ( Node :: Item ( item) ) => item. span ,
0 commit comments