1313use cstore:: { self , CStore , CrateSource , MetadataBlob } ;
1414use locator:: { self , CratePaths } ;
1515use native_libs:: relevant_lib;
16- use schema:: { CrateRoot , Tracked } ;
16+ use schema:: CrateRoot ;
1717
1818use rustc:: hir:: def_id:: { CrateNum , DefIndex } ;
1919use rustc:: hir:: svh:: Svh ;
@@ -261,16 +261,13 @@ impl<'a> CrateLoader<'a> {
261261 crate_root. def_path_table . decode ( & metadata)
262262 } ) ;
263263
264- let exported_symbols = crate_root. exported_symbols
265- . map ( |x| x. decode ( & metadata) . collect ( ) ) ;
264+ let exported_symbols = crate_root. exported_symbols . decode ( & metadata) . collect ( ) ;
266265
267266 let trait_impls = crate_root
268267 . impls
269- . map ( |impls| {
270- impls. decode ( & metadata)
271- . map ( |trait_impls| ( trait_impls. trait_id , trait_impls. impls ) )
272- . collect ( )
273- } ) ;
268+ . decode ( & metadata)
269+ . map ( |trait_impls| ( trait_impls. trait_id , trait_impls. impls ) )
270+ . collect ( ) ;
274271
275272 let mut cmeta = cstore:: CrateMetadata {
276273 name,
@@ -295,23 +292,17 @@ impl<'a> CrateLoader<'a> {
295292 } ,
296293 // Initialize this with an empty set. The field is populated below
297294 // after we were able to deserialize its contents.
298- dllimport_foreign_items : Tracked :: new ( FxHashSet ( ) ) ,
295+ dllimport_foreign_items : FxHashSet ( ) ,
299296 } ;
300297
301- let dllimports: Tracked < FxHashSet < _ > > = cmeta
298+ let dllimports: FxHashSet < _ > = cmeta
302299 . root
303300 . native_libraries
304- . map ( |native_libraries| {
305- let native_libraries: Vec < _ > = native_libraries. decode ( & cmeta)
306- . collect ( ) ;
307- native_libraries
308- . iter ( )
309- . filter ( |lib| relevant_lib ( self . sess , lib) &&
310- lib. kind == cstore:: NativeLibraryKind :: NativeUnknown )
311- . flat_map ( |lib| lib. foreign_items . iter ( ) )
312- . map ( |id| * id)
313- . collect ( )
314- } ) ;
301+ . decode ( & cmeta)
302+ . filter ( |lib| relevant_lib ( self . sess , lib) &&
303+ lib. kind == cstore:: NativeLibraryKind :: NativeUnknown )
304+ . flat_map ( |lib| lib. foreign_items . into_iter ( ) )
305+ . collect ( ) ;
315306
316307 cmeta. dllimport_foreign_items = dllimports;
317308
@@ -469,7 +460,6 @@ impl<'a> CrateLoader<'a> {
469460 // We map 0 and all other holes in the map to our parent crate. The "additional"
470461 // self-dependencies should be harmless.
471462 :: std:: iter:: once ( krate) . chain ( crate_root. crate_deps
472- . get_untracked ( )
473463 . decode ( metadata)
474464 . map ( |dep| {
475465 debug ! ( "resolving dep crate {} hash: `{}`" , dep. name, dep. hash) ;
@@ -692,16 +682,14 @@ impl<'a> CrateLoader<'a> {
692682 let mut needs_panic_runtime = attr:: contains_name ( & krate. attrs ,
693683 "needs_panic_runtime" ) ;
694684
695- let dep_graph = & self . sess . dep_graph ;
696-
697685 self . cstore . iter_crate_data ( |cnum, data| {
698686 needs_panic_runtime = needs_panic_runtime ||
699- data. needs_panic_runtime ( dep_graph ) ;
700- if data. is_panic_runtime ( dep_graph ) {
687+ data. needs_panic_runtime ( ) ;
688+ if data. is_panic_runtime ( ) {
701689 // Inject a dependency from all #![needs_panic_runtime] to this
702690 // #![panic_runtime] crate.
703691 self . inject_dependency_if ( cnum, "a panic runtime" ,
704- & |data| data. needs_panic_runtime ( dep_graph ) ) ;
692+ & |data| data. needs_panic_runtime ( ) ) ;
705693 runtime_found = runtime_found || data. dep_kind . get ( ) == DepKind :: Explicit ;
706694 }
707695 } ) ;
@@ -737,19 +725,19 @@ impl<'a> CrateLoader<'a> {
737725
738726 // Sanity check the loaded crate to ensure it is indeed a panic runtime
739727 // and the panic strategy is indeed what we thought it was.
740- if !data. is_panic_runtime ( dep_graph ) {
728+ if !data. is_panic_runtime ( ) {
741729 self . sess . err ( & format ! ( "the crate `{}` is not a panic runtime" ,
742730 name) ) ;
743731 }
744- if data. panic_strategy ( dep_graph ) != desired_strategy {
732+ if data. panic_strategy ( ) != desired_strategy {
745733 self . sess . err ( & format ! ( "the crate `{}` does not have the panic \
746734 strategy `{}`",
747735 name, desired_strategy. desc( ) ) ) ;
748736 }
749737
750738 self . sess . injected_panic_runtime . set ( Some ( cnum) ) ;
751739 self . inject_dependency_if ( cnum, "a panic runtime" ,
752- & |data| data. needs_panic_runtime ( dep_graph ) ) ;
740+ & |data| data. needs_panic_runtime ( ) ) ;
753741 }
754742
755743 fn inject_sanitizer_runtime ( & mut self ) {
@@ -844,7 +832,7 @@ impl<'a> CrateLoader<'a> {
844832 PathKind :: Crate , dep_kind) ;
845833
846834 // Sanity check the loaded crate to ensure it is indeed a sanitizer runtime
847- if !data. is_sanitizer_runtime ( & self . sess . dep_graph ) {
835+ if !data. is_sanitizer_runtime ( ) {
848836 self . sess . err ( & format ! ( "the crate `{}` is not a sanitizer runtime" ,
849837 name) ) ;
850838 }
@@ -865,7 +853,7 @@ impl<'a> CrateLoader<'a> {
865853 PathKind :: Crate , dep_kind) ;
866854
867855 // Sanity check the loaded crate to ensure it is indeed a profiler runtime
868- if !data. is_profiler_runtime ( & self . sess . dep_graph ) {
856+ if !data. is_profiler_runtime ( ) {
869857 self . sess . err ( & format ! ( "the crate `profiler_builtins` is not \
870858 a profiler runtime") ) ;
871859 }
@@ -883,9 +871,8 @@ impl<'a> CrateLoader<'a> {
883871 // written down in liballoc.
884872 let mut needs_allocator = attr:: contains_name ( & krate. attrs ,
885873 "needs_allocator" ) ;
886- let dep_graph = & self . sess . dep_graph ;
887874 self . cstore . iter_crate_data ( |_, data| {
888- needs_allocator = needs_allocator || data. needs_allocator ( dep_graph ) ;
875+ needs_allocator = needs_allocator || data. needs_allocator ( ) ;
889876 } ) ;
890877 if !needs_allocator {
891878 return
@@ -917,14 +904,13 @@ impl<'a> CrateLoader<'a> {
917904 // First up we check for global allocators. Look at the crate graph here
918905 // and see what's a global allocator, including if we ourselves are a
919906 // global allocator.
920- let dep_graph = & self . sess . dep_graph ;
921907 let mut global_allocator = if has_global_allocator {
922908 Some ( None )
923909 } else {
924910 None
925911 } ;
926912 self . cstore . iter_crate_data ( |_, data| {
927- if !data. has_global_allocator ( dep_graph ) {
913+ if !data. has_global_allocator ( ) {
928914 return
929915 }
930916 match global_allocator {
@@ -983,12 +969,6 @@ impl<'a> CrateLoader<'a> {
983969 DUMMY_SP ,
984970 PathKind :: Crate , dep_kind) ;
985971 self . sess . injected_allocator . set ( Some ( cnum) ) ;
986- // self.cstore.iter_crate_data(|_, data| {
987- // if !data.needs_allocator(dep_graph) {
988- // return
989- // }
990- // data.cnum_map.borrow_mut().push(cnum);
991- // });
992972 }
993973
994974 // We're not actually going to inject an allocator, we're going to
@@ -1001,7 +981,7 @@ impl<'a> CrateLoader<'a> {
1001981 attr:: contains_name ( & krate. attrs , "default_lib_allocator" ) ;
1002982 self . cstore . iter_crate_data ( |_, data| {
1003983 if !found_lib_allocator {
1004- if data. has_default_lib_allocator ( dep_graph ) {
984+ if data. has_default_lib_allocator ( ) {
1005985 found_lib_allocator = true ;
1006986 }
1007987 }
0 commit comments