@@ -58,9 +58,9 @@ pub struct CrateLoader<'a> {
5858fn dump_crates ( cstore : & CStore ) {
5959 info ! ( "resolved crates:" ) ;
6060 cstore. iter_crate_data ( |_, data| {
61- info ! ( " name: {}" , data. name( ) ) ;
61+ info ! ( " name: {}" , data. root . name) ;
6262 info ! ( " cnum: {}" , data. cnum) ;
63- info ! ( " hash: {}" , data. hash( ) ) ;
63+ info ! ( " hash: {}" , data. root . hash) ;
6464 info ! ( " reqd: {:?}" , * data. dep_kind. lock( ) ) ;
6565 let CrateSource { dylib, rlib, rmeta } = data. source . clone ( ) ;
6666 dylib. map ( |dl| info ! ( " dylib: {}" , dl. 0 . display( ) ) ) ;
@@ -113,7 +113,7 @@ impl<'a> CrateLoader<'a> {
113113 if data. name != name { return }
114114
115115 match hash {
116- Some ( hash) if * hash == data. hash ( ) => { ret = Some ( cnum) ; return }
116+ Some ( hash) if * hash == data. root . hash => { ret = Some ( cnum) ; return }
117117 Some ( ..) => return ,
118118 None => { }
119119 }
@@ -172,9 +172,9 @@ impl<'a> CrateLoader<'a> {
172172
173173 // Check for conflicts with any crate loaded so far
174174 self . cstore . iter_crate_data ( |_, other| {
175- if other. name ( ) == root. name && // same crate-name
176- other. disambiguator ( ) == root. disambiguator && // same crate-disambiguator
177- other. hash ( ) != root. hash { // but different SVH
175+ if other. root . name == root. name && // same crate-name
176+ other. root . disambiguator == root. disambiguator && // same crate-disambiguator
177+ other. root . hash != root. hash { // but different SVH
178178 span_fatal ! ( self . sess, span, E0523 ,
179179 "found two different crates with name `{}` that are \
180180 not distinguished by differing `-C metadata`. This \
@@ -343,7 +343,7 @@ impl<'a> CrateLoader<'a> {
343343 if locate_ctxt. triple == & self . sess . opts . target_triple {
344344 let mut result = LoadResult :: Loaded ( library) ;
345345 self . cstore . iter_crate_data ( |cnum, data| {
346- if data. name ( ) == root. name && root. hash == data. hash ( ) {
346+ if data. root . name == root. name && root. hash == data. root . hash {
347347 assert ! ( locate_ctxt. hash. is_none( ) ) ;
348348 info ! ( "load success, going to previous cnum: {}" , cnum) ;
349349 result = LoadResult :: Previous ( cnum) ;
@@ -642,12 +642,12 @@ impl<'a> CrateLoader<'a> {
642642
643643 self . cstore . iter_crate_data ( |cnum, data| {
644644 needs_panic_runtime = needs_panic_runtime ||
645- data. needs_panic_runtime ( ) ;
646- if data. is_panic_runtime ( ) {
645+ data. root . needs_panic_runtime ;
646+ if data. root . panic_runtime {
647647 // Inject a dependency from all #![needs_panic_runtime] to this
648648 // #![panic_runtime] crate.
649649 self . inject_dependency_if ( cnum, "a panic runtime" ,
650- & |data| data. needs_panic_runtime ( ) ) ;
650+ & |data| data. root . needs_panic_runtime ) ;
651651 runtime_found = runtime_found || * data. dep_kind . lock ( ) == DepKind :: Explicit ;
652652 }
653653 } ) ;
@@ -684,19 +684,19 @@ impl<'a> CrateLoader<'a> {
684684
685685 // Sanity check the loaded crate to ensure it is indeed a panic runtime
686686 // and the panic strategy is indeed what we thought it was.
687- if !data. is_panic_runtime ( ) {
687+ if !data. root . panic_runtime {
688688 self . sess . err ( & format ! ( "the crate `{}` is not a panic runtime" ,
689689 name) ) ;
690690 }
691- if data. panic_strategy ( ) != desired_strategy {
691+ if data. root . panic_strategy != desired_strategy {
692692 self . sess . err ( & format ! ( "the crate `{}` does not have the panic \
693693 strategy `{}`",
694694 name, desired_strategy. desc( ) ) ) ;
695695 }
696696
697697 self . sess . injected_panic_runtime . set ( Some ( cnum) ) ;
698698 self . inject_dependency_if ( cnum, "a panic runtime" ,
699- & |data| data. needs_panic_runtime ( ) ) ;
699+ & |data| data. root . needs_panic_runtime ) ;
700700 }
701701
702702 fn inject_sanitizer_runtime ( & mut self ) {
@@ -791,7 +791,7 @@ impl<'a> CrateLoader<'a> {
791791 PathKind :: Crate , dep_kind) ;
792792
793793 // Sanity check the loaded crate to ensure it is indeed a sanitizer runtime
794- if !data. is_sanitizer_runtime ( ) {
794+ if !data. root . sanitizer_runtime {
795795 self . sess . err ( & format ! ( "the crate `{}` is not a sanitizer runtime" ,
796796 name) ) ;
797797 }
@@ -814,7 +814,7 @@ impl<'a> CrateLoader<'a> {
814814 PathKind :: Crate , dep_kind) ;
815815
816816 // Sanity check the loaded crate to ensure it is indeed a profiler runtime
817- if !data. is_profiler_runtime ( ) {
817+ if !data. root . profiler_runtime {
818818 self . sess . err ( & format ! ( "the crate `profiler_builtins` is not \
819819 a profiler runtime") ) ;
820820 }
@@ -831,7 +831,7 @@ impl<'a> CrateLoader<'a> {
831831 let mut needs_allocator = attr:: contains_name ( & krate. attrs ,
832832 "needs_allocator" ) ;
833833 self . cstore . iter_crate_data ( |_, data| {
834- needs_allocator = needs_allocator || data. needs_allocator ( ) ;
834+ needs_allocator = needs_allocator || data. root . needs_allocator ;
835835 } ) ;
836836 if !needs_allocator {
837837 self . sess . injected_allocator . set ( None ) ;
@@ -873,7 +873,7 @@ impl<'a> CrateLoader<'a> {
873873 None
874874 } ;
875875 self . cstore . iter_crate_data ( |_, data| {
876- if !data. has_global_allocator ( ) {
876+ if !data. root . has_global_allocator {
877877 return
878878 }
879879 match global_allocator {
@@ -882,14 +882,14 @@ impl<'a> CrateLoader<'a> {
882882 conflicts with this global \
883883 allocator in: {}",
884884 other_crate,
885- data. name( ) ) ) ;
885+ data. root . name) ) ;
886886 }
887887 Some ( None ) => {
888888 self . sess . err ( & format ! ( "the #[global_allocator] in this \
889889 crate conflicts with global \
890- allocator in: {}", data. name( ) ) ) ;
890+ allocator in: {}", data. root . name) ) ;
891891 }
892- None => global_allocator = Some ( Some ( data. name ( ) ) ) ,
892+ None => global_allocator = Some ( Some ( data. root . name ) ) ,
893893 }
894894 } ) ;
895895 if global_allocator. is_some ( ) {
@@ -951,7 +951,7 @@ impl<'a> CrateLoader<'a> {
951951 // error.
952952 let mut allocator = None ;
953953 self . cstore . iter_crate_data ( |_, data| {
954- if allocator. is_none ( ) && data. has_default_lib_allocator ( ) {
954+ if allocator. is_none ( ) && data. root . has_default_lib_allocator {
955955 allocator = Some ( data. clone ( ) ) ;
956956 }
957957 } ) ;
@@ -1027,9 +1027,9 @@ impl<'a> CrateLoader<'a> {
10271027 self . sess . err ( & format ! ( "the crate `{}` cannot depend \
10281028 on a crate that needs {}, but \
10291029 it depends on `{}`",
1030- self . cstore. get_crate_data( krate) . name( ) ,
1030+ self . cstore. get_crate_data( krate) . root . name,
10311031 what,
1032- data. name( ) ) ) ;
1032+ data. root . name) ) ;
10331033 }
10341034 }
10351035
0 commit comments