3
3
use crate :: cstore:: { self , CStore } ;
4
4
use crate :: locator:: { CrateLocator , CratePaths } ;
5
5
use crate :: rmeta:: { CrateRoot , CrateDep , MetadataBlob } ;
6
- use rustc_data_structures:: sync:: { Lock , Once , AtomicCell } ;
7
6
8
7
use rustc:: hir:: def_id:: CrateNum ;
9
8
use rustc_data_structures:: svh:: Svh ;
10
- use rustc:: dep_graph:: DepNodeIndex ;
11
9
use rustc:: middle:: cstore:: DepKind ;
12
- use rustc:: mir:: interpret:: AllocDecodingState ;
13
10
use rustc:: session:: { Session , CrateDisambiguator } ;
14
11
use rustc:: session:: config:: { Sanitizer , self } ;
15
12
use rustc_target:: spec:: { PanicStrategy , TargetTriple } ;
16
13
use rustc:: session:: search_paths:: PathKind ;
17
14
use rustc:: middle:: cstore:: { CrateSource , ExternCrate , ExternCrateSource , MetadataLoaderDyn } ;
18
- use rustc:: util:: common:: record_time;
19
15
use rustc:: util:: nodemap:: FxHashSet ;
20
16
use rustc:: hir:: map:: Definitions ;
21
17
use rustc:: hir:: def_id:: LOCAL_CRATE ;
@@ -217,8 +213,6 @@ impl<'a> CrateLoader<'a> {
217
213
218
214
let cnum_map = self . resolve_crate_deps ( root, & crate_root, & metadata, cnum, span, dep_kind) ;
219
215
220
- let dependencies: Vec < CrateNum > = cnum_map. iter ( ) . cloned ( ) . collect ( ) ;
221
-
222
216
let raw_proc_macros = crate_root. proc_macro_data . map ( |_| {
223
217
let temp_root;
224
218
let ( dlsym_source, dlsym_root) = match & host_lib {
@@ -230,37 +224,18 @@ impl<'a> CrateLoader<'a> {
230
224
self . dlsym_proc_macros ( & dlsym_dylib. 0 , dlsym_root. disambiguator , span)
231
225
} ) ;
232
226
233
- let interpret_alloc_index: Vec < u32 > = crate_root. interpret_alloc_index
234
- . decode ( & metadata)
235
- . collect ( ) ;
236
- let trait_impls = crate_root
237
- . impls
238
- . decode ( ( & metadata, self . sess ) )
239
- . map ( |trait_impls| ( trait_impls. trait_id , trait_impls. impls ) )
240
- . collect ( ) ;
241
-
242
- let def_path_table = record_time ( & self . sess . perf_stats . decode_def_path_tables_time , || {
243
- crate_root. def_path_table . decode ( ( & metadata, self . sess ) )
244
- } ) ;
245
-
246
- self . cstore . set_crate_data ( cnum, cstore:: CrateMetadata {
247
- extern_crate : Lock :: new ( None ) ,
248
- def_path_table,
249
- trait_impls,
250
- root : crate_root,
251
- host_hash,
252
- blob : metadata,
253
- cnum_map,
227
+ self . cstore . set_crate_data ( cnum, cstore:: CrateMetadata :: new (
228
+ self . sess ,
229
+ metadata,
230
+ crate_root,
231
+ raw_proc_macros,
254
232
cnum,
255
- dependencies : Lock :: new ( dependencies) ,
256
- source_map_import_info : Once :: new ( ) ,
257
- alloc_decoding_state : AllocDecodingState :: new ( interpret_alloc_index) ,
258
- dep_kind : Lock :: new ( dep_kind) ,
233
+ cnum_map,
234
+ dep_kind,
259
235
source,
260
236
private_dep,
261
- raw_proc_macros,
262
- dep_node_index : AtomicCell :: new ( DepNodeIndex :: INVALID ) ,
263
- } ) ;
237
+ host_hash,
238
+ ) ) ;
264
239
265
240
cnum
266
241
}
0 commit comments