@@ -187,7 +187,7 @@ impl<'a> CrateLoader<'a> {
187187 }
188188
189189 fn register_crate (
190- & mut self ,
190+ & self ,
191191 host_lib : Option < Library > ,
192192 root : Option < & CratePaths > ,
193193 span : Span ,
@@ -272,7 +272,7 @@ impl<'a> CrateLoader<'a> {
272272 }
273273
274274 fn load_proc_macro < ' b > (
275- & mut self ,
275+ & self ,
276276 locate_ctxt : & mut locator:: Context < ' b > ,
277277 path_kind : PathKind ,
278278 ) -> Option < ( LoadResult , Option < Library > ) >
@@ -327,7 +327,7 @@ impl<'a> CrateLoader<'a> {
327327 }
328328
329329 fn resolve_crate < ' b > (
330- & ' b mut self ,
330+ & ' b self ,
331331 name : Symbol ,
332332 span : Span ,
333333 dep_kind : DepKind ,
@@ -337,7 +337,7 @@ impl<'a> CrateLoader<'a> {
337337 }
338338
339339 fn maybe_resolve_crate < ' b > (
340- & ' b mut self ,
340+ & ' b self ,
341341 name : Symbol ,
342342 span : Span ,
343343 mut dep_kind : DepKind ,
@@ -397,7 +397,7 @@ impl<'a> CrateLoader<'a> {
397397 }
398398 }
399399
400- fn load ( & mut self , locate_ctxt : & mut locator:: Context < ' _ > ) -> Option < LoadResult > {
400+ fn load ( & self , locate_ctxt : & mut locator:: Context < ' _ > ) -> Option < LoadResult > {
401401 let library = locate_ctxt. maybe_load_library_crate ( ) ?;
402402
403403 // In the case that we're loading a crate, but not matching
@@ -424,7 +424,7 @@ impl<'a> CrateLoader<'a> {
424424 }
425425 }
426426
427- fn update_extern_crate ( & mut self ,
427+ fn update_extern_crate ( & self ,
428428 cnum : CrateNum ,
429429 mut extern_crate : ExternCrate ,
430430 visited : & mut FxHashSet < ( CrateNum , bool ) > )
@@ -466,7 +466,7 @@ impl<'a> CrateLoader<'a> {
466466 }
467467
468468 // Go through the crate metadata and load any crates that it references
469- fn resolve_crate_deps ( & mut self ,
469+ fn resolve_crate_deps ( & self ,
470470 root : & CratePaths ,
471471 crate_root : & CrateRoot < ' _ > ,
472472 metadata : & MetadataBlob ,
@@ -496,7 +496,7 @@ impl<'a> CrateLoader<'a> {
496496 } ) ) . collect ( )
497497 }
498498
499- fn read_extension_crate ( & mut self , name : Symbol , span : Span ) -> ExtensionCrate {
499+ fn read_extension_crate ( & self , name : Symbol , span : Span ) -> ExtensionCrate {
500500 info ! ( "read extension crate `{}`" , name) ;
501501 let target_triple = self . sess . opts . target_triple . clone ( ) ;
502502 let host_triple = TargetTriple :: from_triple ( config:: host_triple ( ) ) ;
@@ -592,7 +592,7 @@ impl<'a> CrateLoader<'a> {
592592
593593 /// Look for a plugin registrar. Returns library path, crate
594594 /// SVH and DefIndex of the registrar function.
595- pub fn find_plugin_registrar ( & mut self ,
595+ pub fn find_plugin_registrar ( & self ,
596596 span : Span ,
597597 name : Symbol )
598598 -> Option < ( PathBuf , CrateDisambiguator ) > {
@@ -625,7 +625,7 @@ impl<'a> CrateLoader<'a> {
625625 }
626626 }
627627
628- fn inject_panic_runtime ( & mut self , krate : & ast:: Crate ) {
628+ fn inject_panic_runtime ( & self , krate : & ast:: Crate ) {
629629 // If we're only compiling an rlib, then there's no need to select a
630630 // panic runtime, so we just skip this section entirely.
631631 let any_non_rlib = self . sess . crate_types . borrow ( ) . iter ( ) . any ( |ct| {
@@ -706,7 +706,7 @@ impl<'a> CrateLoader<'a> {
706706 & |data| data. root . needs_panic_runtime ) ;
707707 }
708708
709- fn inject_sanitizer_runtime ( & mut self ) {
709+ fn inject_sanitizer_runtime ( & self ) {
710710 if let Some ( ref sanitizer) = self . sess . opts . debugging_opts . sanitizer {
711711 // Sanitizers can only be used on some tested platforms with
712712 // executables linked to `std`
@@ -804,7 +804,7 @@ impl<'a> CrateLoader<'a> {
804804 }
805805 }
806806
807- fn inject_profiler_runtime ( & mut self ) {
807+ fn inject_profiler_runtime ( & self ) {
808808 if self . sess . opts . debugging_opts . profile ||
809809 self . sess . opts . cg . profile_generate . enabled ( )
810810 {
@@ -821,7 +821,7 @@ impl<'a> CrateLoader<'a> {
821821 }
822822 }
823823
824- fn inject_allocator_crate ( & mut self , krate : & ast:: Crate ) {
824+ fn inject_allocator_crate ( & self , krate : & ast:: Crate ) {
825825 let has_global_allocator = match & * global_allocator_spans ( krate) {
826826 [ span1, span2, ..] => {
827827 self . sess . struct_span_err ( * span2, "cannot define multiple global allocators" )
@@ -960,7 +960,7 @@ impl<'a> CrateLoader<'a> {
960960}
961961
962962impl < ' a > CrateLoader < ' a > {
963- pub fn postprocess ( & mut self , krate : & ast:: Crate ) {
963+ pub fn postprocess ( & self , krate : & ast:: Crate ) {
964964 self . inject_sanitizer_runtime ( ) ;
965965 self . inject_profiler_runtime ( ) ;
966966 self . inject_allocator_crate ( krate) ;
@@ -971,9 +971,7 @@ impl<'a> CrateLoader<'a> {
971971 }
972972 }
973973
974- pub fn process_extern_crate (
975- & mut self , item : & ast:: Item , definitions : & Definitions ,
976- ) -> CrateNum {
974+ pub fn process_extern_crate ( & self , item : & ast:: Item , definitions : & Definitions ) -> CrateNum {
977975 match item. kind {
978976 ast:: ItemKind :: ExternCrate ( orig_name) => {
979977 debug ! ( "resolving extern crate stmt. ident: {} orig_name: {:?}" ,
@@ -1013,11 +1011,7 @@ impl<'a> CrateLoader<'a> {
10131011 }
10141012 }
10151013
1016- pub fn process_path_extern (
1017- & mut self ,
1018- name : Symbol ,
1019- span : Span ,
1020- ) -> CrateNum {
1014+ pub fn process_path_extern ( & self , name : Symbol , span : Span ) -> CrateNum {
10211015 let cnum = self . resolve_crate ( name, span, DepKind :: Explicit , None ) . 0 ;
10221016
10231017 self . update_extern_crate (
@@ -1035,11 +1029,7 @@ impl<'a> CrateLoader<'a> {
10351029 cnum
10361030 }
10371031
1038- pub fn maybe_process_path_extern (
1039- & mut self ,
1040- name : Symbol ,
1041- span : Span ,
1042- ) -> Option < CrateNum > {
1032+ pub fn maybe_process_path_extern ( & self , name : Symbol , span : Span ) -> Option < CrateNum > {
10431033 let cnum = self . maybe_resolve_crate ( name, span, DepKind :: Explicit , None ) . ok ( ) ?. 0 ;
10441034
10451035 self . update_extern_crate (
0 commit comments