11
11
use cstore;
12
12
use encoder;
13
13
use locator;
14
- use schema;
14
+ use schema:: { self , EntryKind } ;
15
15
16
16
use rustc:: dep_graph:: DepTrackingMapConfig ;
17
17
use rustc:: middle:: cstore:: { CrateStore , CrateSource , LibSource , DepKind ,
@@ -22,7 +22,7 @@ use rustc::middle::lang_items;
22
22
use rustc:: session:: Session ;
23
23
use rustc:: ty:: { self , TyCtxt } ;
24
24
use rustc:: ty:: maps:: Providers ;
25
- use rustc:: hir:: def_id:: { CrateNum , DefId , DefIndex , CRATE_DEF_INDEX , LOCAL_CRATE } ;
25
+ use rustc:: hir:: def_id:: { CrateNum , DefId , DefIndex , CRATE_DEF_INDEX } ;
26
26
27
27
use rustc:: dep_graph:: DepNode ;
28
28
use rustc:: hir:: map:: { DefKey , DefPath , DisambiguatedDefPathData } ;
@@ -128,6 +128,16 @@ provide! { <'tcx> tcx, def_id, cdata
128
128
!cdata. is_proc_macro( def_id. index) &&
129
129
cdata. maybe_entry( def_id. index) . and_then( |item| item. decode( cdata) . mir) . is_some( )
130
130
}
131
+ is_const_fn => { cdata. is_const_fn( def_id. index) }
132
+ is_default_impl => {
133
+ match cdata. entry( def_id. index) . kind {
134
+ EntryKind :: DefaultImpl ( _) => true ,
135
+ _ => false ,
136
+ }
137
+ }
138
+ is_dllimport_foreign_item => {
139
+ cdata. dllimport_foreign_items. contains( & def_id. index)
140
+ }
131
141
}
132
142
133
143
impl CrateStore for cstore:: CStore {
@@ -195,17 +205,6 @@ impl CrateStore for cstore::CStore {
195
205
self . get_crate_data ( def. krate ) . get_associated_item ( def. index )
196
206
}
197
207
198
- fn is_const_fn ( & self , did : DefId ) -> bool
199
- {
200
- self . dep_graph . read ( DepNode :: MetaData ( did) ) ;
201
- self . get_crate_data ( did. krate ) . is_const_fn ( did. index )
202
- }
203
-
204
- fn is_default_impl ( & self , impl_did : DefId ) -> bool {
205
- self . dep_graph . read ( DepNode :: MetaData ( impl_did) ) ;
206
- self . get_crate_data ( impl_did. krate ) . is_default_impl ( impl_did. index )
207
- }
208
-
209
208
fn is_foreign_item ( & self , did : DefId ) -> bool {
210
209
self . get_crate_data ( did. krate ) . is_foreign_item ( did. index )
211
210
}
@@ -219,14 +218,6 @@ impl CrateStore for cstore::CStore {
219
218
self . get_crate_data ( def_id. krate ) . exported_symbols . contains ( & def_id. index )
220
219
}
221
220
222
- fn is_dllimport_foreign_item ( & self , def_id : DefId ) -> bool {
223
- if def_id. krate == LOCAL_CRATE {
224
- self . dllimport_foreign_items . borrow ( ) . contains ( & def_id. index )
225
- } else {
226
- self . get_crate_data ( def_id. krate ) . is_dllimport_foreign_item ( def_id. index )
227
- }
228
- }
229
-
230
221
fn dylib_dependency_formats ( & self , cnum : CrateNum )
231
222
-> Vec < ( CrateNum , LinkagePreference ) >
232
223
{
0 commit comments