@@ -531,7 +531,7 @@ impl<'a> CrateLoader<'a> {
531
531
} ) ;
532
532
if !any_non_rlib {
533
533
info ! ( "panic runtime injection skipped, only generating rlib" ) ;
534
- self . sess . injected_panic_runtime . set ( None ) ;
534
+ self . cstore . injected_panic_runtime = None ;
535
535
return
536
536
}
537
537
@@ -563,7 +563,7 @@ impl<'a> CrateLoader<'a> {
563
563
// we just don't need one at all, then we're done here and there's
564
564
// nothing else to do.
565
565
if !needs_panic_runtime || runtime_found {
566
- self . sess . injected_panic_runtime . set ( None ) ;
566
+ self . cstore . injected_panic_runtime = None ;
567
567
return
568
568
}
569
569
@@ -600,7 +600,7 @@ impl<'a> CrateLoader<'a> {
600
600
name, desired_strategy. desc( ) ) ) ;
601
601
}
602
602
603
- self . sess . injected_panic_runtime . set ( Some ( cnum) ) ;
603
+ self . cstore . injected_panic_runtime = Some ( cnum) ;
604
604
self . inject_dependency_if ( cnum, "a panic runtime" ,
605
605
& |data| data. root . needs_panic_runtime ) ;
606
606
}
@@ -722,7 +722,7 @@ impl<'a> CrateLoader<'a> {
722
722
}
723
723
}
724
724
725
- fn inject_allocator_crate ( & self , krate : & ast:: Crate ) {
725
+ fn inject_allocator_crate ( & mut self , krate : & ast:: Crate ) {
726
726
let has_global_allocator = match & * global_allocator_spans ( krate) {
727
727
[ span1, span2, ..] => {
728
728
self . sess . struct_span_err ( * span2, "cannot define multiple global allocators" )
@@ -742,7 +742,7 @@ impl<'a> CrateLoader<'a> {
742
742
needs_allocator = needs_allocator || data. root . needs_allocator ;
743
743
} ) ;
744
744
if !needs_allocator {
745
- self . sess . allocator_kind . set ( None ) ;
745
+ self . cstore . allocator_kind = None ;
746
746
return
747
747
}
748
748
@@ -758,7 +758,7 @@ impl<'a> CrateLoader<'a> {
758
758
}
759
759
} ) ;
760
760
if all_rlib {
761
- self . sess . allocator_kind . set ( None ) ;
761
+ self . cstore . allocator_kind = None ;
762
762
return
763
763
}
764
764
@@ -795,7 +795,7 @@ impl<'a> CrateLoader<'a> {
795
795
}
796
796
} ) ;
797
797
if global_allocator. is_some ( ) {
798
- self . sess . allocator_kind . set ( Some ( AllocatorKind :: Global ) ) ;
798
+ self . cstore . allocator_kind = Some ( AllocatorKind :: Global ) ;
799
799
return
800
800
}
801
801
@@ -816,7 +816,7 @@ impl<'a> CrateLoader<'a> {
816
816
add `#[global_allocator]` to a static item \
817
817
that implements the GlobalAlloc trait.") ;
818
818
}
819
- self . sess . allocator_kind . set ( Some ( AllocatorKind :: DefaultLib ) ) ;
819
+ self . cstore . allocator_kind = Some ( AllocatorKind :: DefaultLib ) ;
820
820
}
821
821
822
822
fn inject_dependency_if ( & self ,
0 commit comments