@@ -4,15 +4,15 @@ pub use self::definitions::{
4
4
} ;
5
5
6
6
use crate :: arena:: Arena ;
7
- use crate :: dep_graph:: { DepGraph , DepKind , DepNode , DepNodeIndex } ;
7
+ use crate :: dep_graph:: { DepGraph , DepNodeIndex } ;
8
8
use crate :: hir:: { HirOwner , HirOwnerItems } ;
9
9
use crate :: middle:: cstore:: CrateStoreDyn ;
10
10
use crate :: ty:: query:: Providers ;
11
11
use crate :: ty:: TyCtxt ;
12
12
use rustc_data_structures:: fx:: FxHashMap ;
13
13
use rustc_data_structures:: svh:: Svh ;
14
14
use rustc_hir:: def:: { DefKind , Res } ;
15
- use rustc_hir:: def_id:: { DefId , DefIndex , LocalDefId } ;
15
+ use rustc_hir:: def_id:: { DefId , DefIndex , LocalDefId , LOCAL_CRATE } ;
16
16
use rustc_hir:: intravisit;
17
17
use rustc_hir:: itemlikevisit:: ItemLikeVisitor ;
18
18
use rustc_hir:: print:: Nested ;
@@ -537,11 +537,7 @@ impl<'hir> Map<'hir> {
537
537
}
538
538
539
539
pub fn trait_impls ( & self , trait_did : DefId ) -> & ' hir [ HirId ] {
540
- self . dep_graph . read ( DepNode :: new_no_params ( DepKind :: AllLocalTraitImpls ) ) ;
541
-
542
- // N.B., intentionally bypass `self.krate()` so that we
543
- // do not trigger a read of the whole krate here
544
- self . krate . trait_impls . get ( & trait_did) . map_or ( & [ ] , |xs| & xs[ ..] )
540
+ self . tcx . all_local_trait_impls ( LOCAL_CRATE ) . get ( & trait_did) . map_or ( & [ ] , |xs| & xs[ ..] )
545
541
}
546
542
547
543
/// Gets the attributes on the crate. This is preferable to
0 commit comments