@@ -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`.
@@ -220,27 +218,6 @@ impl<'hir> Map<'hir> {
220
218
& self . krate
221
219
}
222
220
223
- #[ inline]
224
- fn lookup ( & self , id : HirId ) -> Option < & Entry < ' hir > > {
225
- let local_map = self . map . get ( id. owner ) ?;
226
- local_map. get ( id. local_id ) ?. as_ref ( )
227
- }
228
-
229
- /// Registers a read in the dependency graph of the AST node with
230
- /// the given `id`. This needs to be called each time a public
231
- /// function returns the HIR for a node -- in other words, when it
232
- /// "reveals" the content of a node to the caller (who might not
233
- /// otherwise have had access to those contents, and hence needs a
234
- /// read recorded). If the function just returns a DefId or
235
- /// HirId, no actual content was returned, so no read is needed.
236
- pub fn read ( & self , hir_id : HirId ) {
237
- if let Some ( entry) = self . lookup ( hir_id) {
238
- self . dep_graph . read_index ( entry. dep_node ) ;
239
- } else {
240
- bug ! ( "called `HirMap::read()` with invalid `HirId`: {:?}" , hir_id)
241
- }
242
- }
243
-
244
221
#[ inline]
245
222
pub fn definitions ( & self ) -> & Definitions {
246
223
& self . definitions
@@ -943,7 +920,6 @@ impl<'hir> Map<'hir> {
943
920
/// Given a node ID, gets a list of attributes associated with the AST
944
921
/// corresponding to the node-ID.
945
922
pub fn attrs ( & self , id : HirId ) -> & ' hir [ ast:: Attribute ] {
946
- self . read ( id) ; // reveals attributes on the node
947
923
let attrs = match self . find_entry ( id) . map ( |entry| entry. node ) {
948
924
Some ( Node :: Param ( a) ) => Some ( & a. attrs [ ..] ) ,
949
925
Some ( Node :: Local ( l) ) => Some ( & l. attrs [ ..] ) ,
@@ -967,7 +943,6 @@ impl<'hir> Map<'hir> {
967
943
}
968
944
969
945
pub fn span ( & self , hir_id : HirId ) -> Span {
970
- self . read ( hir_id) ; // reveals span from node
971
946
match self . find_entry ( hir_id) . map ( |entry| entry. node ) {
972
947
Some ( Node :: Param ( param) ) => param. span ,
973
948
Some ( Node :: Item ( item) ) => item. span ,
0 commit comments