@@ -179,7 +179,7 @@ impl<'a> CrateLoader<'a> {
179
179
}
180
180
181
181
fn register_crate (
182
- & self ,
182
+ & mut self ,
183
183
host_lib : Option < Library > ,
184
184
root : Option < & CratePaths > ,
185
185
span : Span ,
@@ -319,7 +319,7 @@ impl<'a> CrateLoader<'a> {
319
319
}
320
320
321
321
fn resolve_crate < ' b > (
322
- & ' b self ,
322
+ & ' b mut self ,
323
323
name : Symbol ,
324
324
span : Span ,
325
325
dep_kind : DepKind ,
@@ -329,7 +329,7 @@ impl<'a> CrateLoader<'a> {
329
329
}
330
330
331
331
fn maybe_resolve_crate < ' b > (
332
- & ' b self ,
332
+ & ' b mut self ,
333
333
name : Symbol ,
334
334
span : Span ,
335
335
mut dep_kind : DepKind ,
@@ -458,7 +458,7 @@ impl<'a> CrateLoader<'a> {
458
458
}
459
459
460
460
// Go through the crate metadata and load any crates that it references
461
- fn resolve_crate_deps ( & self ,
461
+ fn resolve_crate_deps ( & mut self ,
462
462
root : & CratePaths ,
463
463
crate_root : & CrateRoot < ' _ > ,
464
464
metadata : & MetadataBlob ,
@@ -519,7 +519,7 @@ impl<'a> CrateLoader<'a> {
519
519
decls
520
520
}
521
521
522
- fn inject_panic_runtime ( & self , krate : & ast:: Crate ) {
522
+ fn inject_panic_runtime ( & mut self , krate : & ast:: Crate ) {
523
523
// If we're only compiling an rlib, then there's no need to select a
524
524
// panic runtime, so we just skip this section entirely.
525
525
let any_non_rlib = self . sess . crate_types . borrow ( ) . iter ( ) . any ( |ct| {
@@ -600,7 +600,7 @@ impl<'a> CrateLoader<'a> {
600
600
& |data| data. root . needs_panic_runtime ) ;
601
601
}
602
602
603
- fn inject_sanitizer_runtime ( & self ) {
603
+ fn inject_sanitizer_runtime ( & mut self ) {
604
604
if let Some ( ref sanitizer) = self . sess . opts . debugging_opts . sanitizer {
605
605
// Sanitizers can only be used on some tested platforms with
606
606
// executables linked to `std`
@@ -698,7 +698,7 @@ impl<'a> CrateLoader<'a> {
698
698
}
699
699
}
700
700
701
- fn inject_profiler_runtime ( & self ) {
701
+ fn inject_profiler_runtime ( & mut self ) {
702
702
if self . sess . opts . debugging_opts . profile ||
703
703
self . sess . opts . cg . profile_generate . enabled ( )
704
704
{
@@ -852,7 +852,7 @@ impl<'a> CrateLoader<'a> {
852
852
} ) ;
853
853
}
854
854
855
- pub fn postprocess ( & self , krate : & ast:: Crate ) {
855
+ pub fn postprocess ( & mut self , krate : & ast:: Crate ) {
856
856
self . inject_sanitizer_runtime ( ) ;
857
857
self . inject_profiler_runtime ( ) ;
858
858
self . inject_allocator_crate ( krate) ;
@@ -863,7 +863,11 @@ impl<'a> CrateLoader<'a> {
863
863
}
864
864
}
865
865
866
- pub fn process_extern_crate ( & self , item : & ast:: Item , definitions : & Definitions ) -> CrateNum {
866
+ pub fn process_extern_crate (
867
+ & mut self ,
868
+ item : & ast:: Item ,
869
+ definitions : & Definitions ,
870
+ ) -> CrateNum {
867
871
match item. kind {
868
872
ast:: ItemKind :: ExternCrate ( orig_name) => {
869
873
debug ! ( "resolving extern crate stmt. ident: {} orig_name: {:?}" ,
@@ -902,7 +906,7 @@ impl<'a> CrateLoader<'a> {
902
906
}
903
907
}
904
908
905
- pub fn process_path_extern ( & self , name : Symbol , span : Span ) -> CrateNum {
909
+ pub fn process_path_extern ( & mut self , name : Symbol , span : Span ) -> CrateNum {
906
910
let cnum = self . resolve_crate ( name, span, DepKind :: Explicit , None ) . 0 ;
907
911
908
912
self . update_extern_crate (
@@ -920,7 +924,7 @@ impl<'a> CrateLoader<'a> {
920
924
cnum
921
925
}
922
926
923
- pub fn maybe_process_path_extern ( & self , name : Symbol , span : Span ) -> Option < CrateNum > {
927
+ pub fn maybe_process_path_extern ( & mut self , name : Symbol , span : Span ) -> Option < CrateNum > {
924
928
let cnum = self . maybe_resolve_crate ( name, span, DepKind :: Explicit , None ) . ok ( ) ?. 0 ;
925
929
926
930
self . update_extern_crate (
0 commit comments