1111use cstore;
1212use encoder;
1313use locator;
14- use schema;
14+ use schema:: { self , EntryKind } ;
1515
1616use rustc:: dep_graph:: DepTrackingMapConfig ;
1717use rustc:: middle:: cstore:: { CrateStore , CrateSource , LibSource , DepKind ,
@@ -22,7 +22,7 @@ use rustc::middle::lang_items;
2222use rustc:: session:: Session ;
2323use rustc:: ty:: { self , TyCtxt } ;
2424use 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 } ;
2626
2727use rustc:: dep_graph:: DepNode ;
2828use rustc:: hir:: map:: { DefKey , DefPath , DisambiguatedDefPathData } ;
@@ -128,6 +128,16 @@ provide! { <'tcx> tcx, def_id, cdata
128128 !cdata. is_proc_macro( def_id. index) &&
129129 cdata. maybe_entry( def_id. index) . and_then( |item| item. decode( cdata) . mir) . is_some( )
130130 }
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+ }
131141}
132142
133143impl CrateStore for cstore:: CStore {
@@ -195,17 +205,6 @@ impl CrateStore for cstore::CStore {
195205 self . get_crate_data ( def. krate ) . get_associated_item ( def. index )
196206 }
197207
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-
209208 fn is_foreign_item ( & self , did : DefId ) -> bool {
210209 self . get_crate_data ( did. krate ) . is_foreign_item ( did. index )
211210 }
@@ -219,14 +218,6 @@ impl CrateStore for cstore::CStore {
219218 self . get_crate_data ( def_id. krate ) . exported_symbols . contains ( & def_id. index )
220219 }
221220
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-
230221 fn dylib_dependency_formats ( & self , cnum : CrateNum )
231222 -> Vec < ( CrateNum , LinkagePreference ) >
232223 {
0 commit comments