@@ -531,7 +531,7 @@ impl<'a> CrateLoader<'a> {
531531 } ) ;
532532 if !any_non_rlib {
533533 info ! ( "panic runtime injection skipped, only generating rlib" ) ;
534- self . sess . injected_panic_runtime . set ( None ) ;
534+ self . cstore . injected_panic_runtime = None ;
535535 return
536536 }
537537
@@ -563,7 +563,7 @@ impl<'a> CrateLoader<'a> {
563563 // we just don't need one at all, then we're done here and there's
564564 // nothing else to do.
565565 if !needs_panic_runtime || runtime_found {
566- self . sess . injected_panic_runtime . set ( None ) ;
566+ self . cstore . injected_panic_runtime = None ;
567567 return
568568 }
569569
@@ -600,7 +600,7 @@ impl<'a> CrateLoader<'a> {
600600 name, desired_strategy. desc( ) ) ) ;
601601 }
602602
603- self . sess . injected_panic_runtime . set ( Some ( cnum) ) ;
603+ self . cstore . injected_panic_runtime = Some ( cnum) ;
604604 self . inject_dependency_if ( cnum, "a panic runtime" ,
605605 & |data| data. root . needs_panic_runtime ) ;
606606 }
@@ -722,7 +722,7 @@ impl<'a> CrateLoader<'a> {
722722 }
723723 }
724724
725- fn inject_allocator_crate ( & self , krate : & ast:: Crate ) {
725+ fn inject_allocator_crate ( & mut self , krate : & ast:: Crate ) {
726726 let has_global_allocator = match & * global_allocator_spans ( krate) {
727727 [ span1, span2, ..] => {
728728 self . sess . struct_span_err ( * span2, "cannot define multiple global allocators" )
@@ -742,7 +742,7 @@ impl<'a> CrateLoader<'a> {
742742 needs_allocator = needs_allocator || data. root . needs_allocator ;
743743 } ) ;
744744 if !needs_allocator {
745- self . sess . allocator_kind . set ( None ) ;
745+ self . cstore . allocator_kind = None ;
746746 return
747747 }
748748
@@ -758,7 +758,7 @@ impl<'a> CrateLoader<'a> {
758758 }
759759 } ) ;
760760 if all_rlib {
761- self . sess . allocator_kind . set ( None ) ;
761+ self . cstore . allocator_kind = None ;
762762 return
763763 }
764764
@@ -795,7 +795,7 @@ impl<'a> CrateLoader<'a> {
795795 }
796796 } ) ;
797797 if global_allocator. is_some ( ) {
798- self . sess . allocator_kind . set ( Some ( AllocatorKind :: Global ) ) ;
798+ self . cstore . allocator_kind = Some ( AllocatorKind :: Global ) ;
799799 return
800800 }
801801
@@ -816,7 +816,7 @@ impl<'a> CrateLoader<'a> {
816816 add `#[global_allocator]` to a static item \
817817 that implements the GlobalAlloc trait.") ;
818818 }
819- self . sess . allocator_kind . set ( Some ( AllocatorKind :: DefaultLib ) ) ;
819+ self . cstore . allocator_kind = Some ( AllocatorKind :: DefaultLib ) ;
820820 }
821821
822822 fn inject_dependency_if ( & self ,
0 commit comments