@@ -56,9 +56,9 @@ pub struct CrateLoader<'a> {
5656fn dump_crates ( cstore : & CStore ) {
5757 info ! ( "resolved crates:" ) ;
5858 cstore. iter_crate_data ( |_, data| {
59- info ! ( " name: {}" , data. name( ) ) ;
59+ info ! ( " name: {}" , data. root . name) ;
6060 info ! ( " cnum: {}" , data. cnum) ;
61- info ! ( " hash: {}" , data. hash( ) ) ;
61+ info ! ( " hash: {}" , data. root . hash) ;
6262 info ! ( " reqd: {:?}" , * data. dep_kind. lock( ) ) ;
6363 let CrateSource { dylib, rlib, rmeta } = data. source . clone ( ) ;
6464 dylib. map ( |dl| info ! ( " dylib: {}" , dl. 0 . display( ) ) ) ;
@@ -111,7 +111,7 @@ impl<'a> CrateLoader<'a> {
111111 if data. name != name { return }
112112
113113 match hash {
114- Some ( hash) if * hash == data. hash ( ) => { ret = Some ( cnum) ; return }
114+ Some ( hash) if * hash == data. root . hash => { ret = Some ( cnum) ; return }
115115 Some ( ..) => return ,
116116 None => { }
117117 }
@@ -170,9 +170,9 @@ impl<'a> CrateLoader<'a> {
170170
171171 // Check for conflicts with any crate loaded so far
172172 self . cstore . iter_crate_data ( |_, other| {
173- if other. name ( ) == root. name && // same crate-name
174- other. disambiguator ( ) == root. disambiguator && // same crate-disambiguator
175- other. hash ( ) != root. hash { // but different SVH
173+ if other. root . name == root. name && // same crate-name
174+ other. root . disambiguator == root. disambiguator && // same crate-disambiguator
175+ other. root . hash != root. hash { // but different SVH
176176 span_fatal ! ( self . sess, span, E0523 ,
177177 "found two different crates with name `{}` that are \
178178 not distinguished by differing `-C metadata`. This \
@@ -341,7 +341,7 @@ impl<'a> CrateLoader<'a> {
341341 if locate_ctxt. triple == & self . sess . opts . target_triple {
342342 let mut result = LoadResult :: Loaded ( library) ;
343343 self . cstore . iter_crate_data ( |cnum, data| {
344- if data. name ( ) == root. name && root. hash == data. hash ( ) {
344+ if data. root . name == root. name && root. hash == data. root . hash {
345345 assert ! ( locate_ctxt. hash. is_none( ) ) ;
346346 info ! ( "load success, going to previous cnum: {}" , cnum) ;
347347 result = LoadResult :: Previous ( cnum) ;
@@ -635,12 +635,12 @@ impl<'a> CrateLoader<'a> {
635635
636636 self . cstore . iter_crate_data ( |cnum, data| {
637637 needs_panic_runtime = needs_panic_runtime ||
638- data. needs_panic_runtime ( ) ;
639- if data. is_panic_runtime ( ) {
638+ data. root . needs_panic_runtime ;
639+ if data. root . panic_runtime {
640640 // Inject a dependency from all #![needs_panic_runtime] to this
641641 // #![panic_runtime] crate.
642642 self . inject_dependency_if ( cnum, "a panic runtime" ,
643- & |data| data. needs_panic_runtime ( ) ) ;
643+ & |data| data. root . needs_panic_runtime ) ;
644644 runtime_found = runtime_found || * data. dep_kind . lock ( ) == DepKind :: Explicit ;
645645 }
646646 } ) ;
@@ -677,19 +677,19 @@ impl<'a> CrateLoader<'a> {
677677
678678 // Sanity check the loaded crate to ensure it is indeed a panic runtime
679679 // and the panic strategy is indeed what we thought it was.
680- if !data. is_panic_runtime ( ) {
680+ if !data. root . panic_runtime {
681681 self . sess . err ( & format ! ( "the crate `{}` is not a panic runtime" ,
682682 name) ) ;
683683 }
684- if data. panic_strategy ( ) != desired_strategy {
684+ if data. root . panic_strategy != desired_strategy {
685685 self . sess . err ( & format ! ( "the crate `{}` does not have the panic \
686686 strategy `{}`",
687687 name, desired_strategy. desc( ) ) ) ;
688688 }
689689
690690 self . sess . injected_panic_runtime . set ( Some ( cnum) ) ;
691691 self . inject_dependency_if ( cnum, "a panic runtime" ,
692- & |data| data. needs_panic_runtime ( ) ) ;
692+ & |data| data. root . needs_panic_runtime ) ;
693693 }
694694
695695 fn inject_sanitizer_runtime ( & mut self ) {
@@ -784,7 +784,7 @@ impl<'a> CrateLoader<'a> {
784784 PathKind :: Crate , dep_kind) ;
785785
786786 // Sanity check the loaded crate to ensure it is indeed a sanitizer runtime
787- if !data. is_sanitizer_runtime ( ) {
787+ if !data. root . sanitizer_runtime {
788788 self . sess . err ( & format ! ( "the crate `{}` is not a sanitizer runtime" ,
789789 name) ) ;
790790 }
@@ -807,7 +807,7 @@ impl<'a> CrateLoader<'a> {
807807 PathKind :: Crate , dep_kind) ;
808808
809809 // Sanity check the loaded crate to ensure it is indeed a profiler runtime
810- if !data. is_profiler_runtime ( ) {
810+ if !data. root . profiler_runtime {
811811 self . sess . err ( & format ! ( "the crate `profiler_builtins` is not \
812812 a profiler runtime") ) ;
813813 }
@@ -824,7 +824,7 @@ impl<'a> CrateLoader<'a> {
824824 let mut needs_allocator = attr:: contains_name ( & krate. attrs ,
825825 "needs_allocator" ) ;
826826 self . cstore . iter_crate_data ( |_, data| {
827- needs_allocator = needs_allocator || data. needs_allocator ( ) ;
827+ needs_allocator = needs_allocator || data. root . needs_allocator ;
828828 } ) ;
829829 if !needs_allocator {
830830 self . sess . injected_allocator . set ( None ) ;
@@ -866,7 +866,7 @@ impl<'a> CrateLoader<'a> {
866866 None
867867 } ;
868868 self . cstore . iter_crate_data ( |_, data| {
869- if !data. has_global_allocator ( ) {
869+ if !data. root . has_global_allocator {
870870 return
871871 }
872872 match global_allocator {
@@ -875,14 +875,14 @@ impl<'a> CrateLoader<'a> {
875875 conflicts with this global \
876876 allocator in: {}",
877877 other_crate,
878- data. name( ) ) ) ;
878+ data. root . name) ) ;
879879 }
880880 Some ( None ) => {
881881 self . sess . err ( & format ! ( "the #[global_allocator] in this \
882882 crate conflicts with global \
883- allocator in: {}", data. name( ) ) ) ;
883+ allocator in: {}", data. root . name) ) ;
884884 }
885- None => global_allocator = Some ( Some ( data. name ( ) ) ) ,
885+ None => global_allocator = Some ( Some ( data. root . name ) ) ,
886886 }
887887 } ) ;
888888 if global_allocator. is_some ( ) {
@@ -944,7 +944,7 @@ impl<'a> CrateLoader<'a> {
944944 // error.
945945 let mut allocator = None ;
946946 self . cstore . iter_crate_data ( |_, data| {
947- if allocator. is_none ( ) && data. has_default_lib_allocator ( ) {
947+ if allocator. is_none ( ) && data. root . has_default_lib_allocator {
948948 allocator = Some ( data. clone ( ) ) ;
949949 }
950950 } ) ;
@@ -1020,9 +1020,9 @@ impl<'a> CrateLoader<'a> {
10201020 self . sess . err ( & format ! ( "the crate `{}` cannot depend \
10211021 on a crate that needs {}, but \
10221022 it depends on `{}`",
1023- self . cstore. get_crate_data( krate) . name( ) ,
1023+ self . cstore. get_crate_data( krate) . root . name,
10241024 what,
1025- data. name( ) ) ) ;
1025+ data. root . name) ) ;
10261026 }
10271027 }
10281028
0 commit comments