@@ -94,13 +94,14 @@ pub enum Linkage {
9494
9595pub fn calculate < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) {
9696 let sess = & tcx. sess ;
97- let mut fmts = sess . dependency_formats . borrow_mut ( ) ;
97+ let mut fmts = FxHashMap ( ) ;
9898 for & ty in sess. crate_types . borrow ( ) . iter ( ) {
9999 let linkage = calculate_type ( tcx, ty) ;
100100 verify_ok ( tcx, & linkage) ;
101101 fmts. insert ( ty, linkage) ;
102102 }
103103 sess. abort_if_errors ( ) ;
104+ sess. dependency_formats . set ( fmts) ;
104105}
105106
106107fn calculate_type < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
@@ -222,7 +223,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
222223 //
223224 // Things like allocators and panic runtimes may not have been activated
224225 // quite yet, so do so here.
225- activate_injected_dep ( sess. injected_panic_runtime . get ( ) , & mut ret,
226+ activate_injected_dep ( * sess. injected_panic_runtime . get ( ) , & mut ret,
226227 & |cnum| tcx. is_panic_runtime ( cnum) ) ;
227228 activate_injected_allocator ( sess, & mut ret) ;
228229
@@ -301,7 +302,7 @@ fn attempt_static<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Option<DependencyLis
301302 // Our allocator/panic runtime may not have been linked above if it wasn't
302303 // explicitly linked, which is the case for any injected dependency. Handle
303304 // that here and activate them.
304- activate_injected_dep ( sess. injected_panic_runtime . get ( ) , & mut ret,
305+ activate_injected_dep ( * sess. injected_panic_runtime . get ( ) , & mut ret,
305306 & |cnum| tcx. is_panic_runtime ( cnum) ) ;
306307 activate_injected_allocator ( sess, & mut ret) ;
307308
0 commit comments