@@ -179,7 +179,7 @@ impl<'a> CrateLoader<'a> {
179179 }
180180
181181 fn register_crate (
182- & self ,
182+ & mut self ,
183183 host_lib : Option < Library > ,
184184 root : Option < & CratePaths > ,
185185 span : Span ,
@@ -319,7 +319,7 @@ impl<'a> CrateLoader<'a> {
319319 }
320320
321321 fn resolve_crate < ' b > (
322- & ' b self ,
322+ & ' b mut self ,
323323 name : Symbol ,
324324 span : Span ,
325325 dep_kind : DepKind ,
@@ -329,7 +329,7 @@ impl<'a> CrateLoader<'a> {
329329 }
330330
331331 fn maybe_resolve_crate < ' b > (
332- & ' b self ,
332+ & ' b mut self ,
333333 name : Symbol ,
334334 span : Span ,
335335 mut dep_kind : DepKind ,
@@ -458,7 +458,7 @@ impl<'a> CrateLoader<'a> {
458458 }
459459
460460 // 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 ,
462462 root : & CratePaths ,
463463 crate_root : & CrateRoot < ' _ > ,
464464 metadata : & MetadataBlob ,
@@ -519,7 +519,7 @@ impl<'a> CrateLoader<'a> {
519519 decls
520520 }
521521
522- fn inject_panic_runtime ( & self , krate : & ast:: Crate ) {
522+ fn inject_panic_runtime ( & mut self , krate : & ast:: Crate ) {
523523 // If we're only compiling an rlib, then there's no need to select a
524524 // panic runtime, so we just skip this section entirely.
525525 let any_non_rlib = self . sess . crate_types . borrow ( ) . iter ( ) . any ( |ct| {
@@ -600,7 +600,7 @@ impl<'a> CrateLoader<'a> {
600600 & |data| data. root . needs_panic_runtime ) ;
601601 }
602602
603- fn inject_sanitizer_runtime ( & self ) {
603+ fn inject_sanitizer_runtime ( & mut self ) {
604604 if let Some ( ref sanitizer) = self . sess . opts . debugging_opts . sanitizer {
605605 // Sanitizers can only be used on some tested platforms with
606606 // executables linked to `std`
@@ -698,7 +698,7 @@ impl<'a> CrateLoader<'a> {
698698 }
699699 }
700700
701- fn inject_profiler_runtime ( & self ) {
701+ fn inject_profiler_runtime ( & mut self ) {
702702 if self . sess . opts . debugging_opts . profile ||
703703 self . sess . opts . cg . profile_generate . enabled ( )
704704 {
@@ -852,7 +852,7 @@ impl<'a> CrateLoader<'a> {
852852 } ) ;
853853 }
854854
855- pub fn postprocess ( & self , krate : & ast:: Crate ) {
855+ pub fn postprocess ( & mut self , krate : & ast:: Crate ) {
856856 self . inject_sanitizer_runtime ( ) ;
857857 self . inject_profiler_runtime ( ) ;
858858 self . inject_allocator_crate ( krate) ;
@@ -863,7 +863,11 @@ impl<'a> CrateLoader<'a> {
863863 }
864864 }
865865
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 {
867871 match item. kind {
868872 ast:: ItemKind :: ExternCrate ( orig_name) => {
869873 debug ! ( "resolving extern crate stmt. ident: {} orig_name: {:?}" ,
@@ -902,7 +906,7 @@ impl<'a> CrateLoader<'a> {
902906 }
903907 }
904908
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 {
906910 let cnum = self . resolve_crate ( name, span, DepKind :: Explicit , None ) . 0 ;
907911
908912 self . update_extern_crate (
@@ -920,7 +924,7 @@ impl<'a> CrateLoader<'a> {
920924 cnum
921925 }
922926
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 > {
924928 let cnum = self . maybe_resolve_crate ( name, span, DepKind :: Explicit , None ) . ok ( ) ?. 0 ;
925929
926930 self . update_extern_crate (
0 commit comments