@@ -56,9 +56,9 @@ pub struct CrateLoader<'a> {
56
56
fn dump_crates ( cstore : & CStore ) {
57
57
info ! ( "resolved crates:" ) ;
58
58
cstore. iter_crate_data ( |_, data| {
59
- info ! ( " name: {}" , data. name( ) ) ;
59
+ info ! ( " name: {}" , data. root . name) ;
60
60
info ! ( " cnum: {}" , data. cnum) ;
61
- info ! ( " hash: {}" , data. hash( ) ) ;
61
+ info ! ( " hash: {}" , data. root . hash) ;
62
62
info ! ( " reqd: {:?}" , * data. dep_kind. lock( ) ) ;
63
63
let CrateSource { dylib, rlib, rmeta } = data. source . clone ( ) ;
64
64
dylib. map ( |dl| info ! ( " dylib: {}" , dl. 0 . display( ) ) ) ;
@@ -111,7 +111,7 @@ impl<'a> CrateLoader<'a> {
111
111
if data. name != name { return }
112
112
113
113
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 }
115
115
Some ( ..) => return ,
116
116
None => { }
117
117
}
@@ -170,9 +170,9 @@ impl<'a> CrateLoader<'a> {
170
170
171
171
// Check for conflicts with any crate loaded so far
172
172
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
176
176
span_fatal ! ( self . sess, span, E0523 ,
177
177
"found two different crates with name `{}` that are \
178
178
not distinguished by differing `-C metadata`. This \
@@ -341,7 +341,7 @@ impl<'a> CrateLoader<'a> {
341
341
if locate_ctxt. triple == & self . sess . opts . target_triple {
342
342
let mut result = LoadResult :: Loaded ( library) ;
343
343
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 {
345
345
assert ! ( locate_ctxt. hash. is_none( ) ) ;
346
346
info ! ( "load success, going to previous cnum: {}" , cnum) ;
347
347
result = LoadResult :: Previous ( cnum) ;
@@ -635,12 +635,12 @@ impl<'a> CrateLoader<'a> {
635
635
636
636
self . cstore . iter_crate_data ( |cnum, data| {
637
637
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 {
640
640
// Inject a dependency from all #![needs_panic_runtime] to this
641
641
// #![panic_runtime] crate.
642
642
self . inject_dependency_if ( cnum, "a panic runtime" ,
643
- & |data| data. needs_panic_runtime ( ) ) ;
643
+ & |data| data. root . needs_panic_runtime ) ;
644
644
runtime_found = runtime_found || * data. dep_kind . lock ( ) == DepKind :: Explicit ;
645
645
}
646
646
} ) ;
@@ -677,19 +677,19 @@ impl<'a> CrateLoader<'a> {
677
677
678
678
// Sanity check the loaded crate to ensure it is indeed a panic runtime
679
679
// and the panic strategy is indeed what we thought it was.
680
- if !data. is_panic_runtime ( ) {
680
+ if !data. root . panic_runtime {
681
681
self . sess . err ( & format ! ( "the crate `{}` is not a panic runtime" ,
682
682
name) ) ;
683
683
}
684
- if data. panic_strategy ( ) != desired_strategy {
684
+ if data. root . panic_strategy != desired_strategy {
685
685
self . sess . err ( & format ! ( "the crate `{}` does not have the panic \
686
686
strategy `{}`",
687
687
name, desired_strategy. desc( ) ) ) ;
688
688
}
689
689
690
690
self . sess . injected_panic_runtime . set ( Some ( cnum) ) ;
691
691
self . inject_dependency_if ( cnum, "a panic runtime" ,
692
- & |data| data. needs_panic_runtime ( ) ) ;
692
+ & |data| data. root . needs_panic_runtime ) ;
693
693
}
694
694
695
695
fn inject_sanitizer_runtime ( & mut self ) {
@@ -784,7 +784,7 @@ impl<'a> CrateLoader<'a> {
784
784
PathKind :: Crate , dep_kind) ;
785
785
786
786
// 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 {
788
788
self . sess . err ( & format ! ( "the crate `{}` is not a sanitizer runtime" ,
789
789
name) ) ;
790
790
}
@@ -807,7 +807,7 @@ impl<'a> CrateLoader<'a> {
807
807
PathKind :: Crate , dep_kind) ;
808
808
809
809
// 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 {
811
811
self . sess . err ( & format ! ( "the crate `profiler_builtins` is not \
812
812
a profiler runtime") ) ;
813
813
}
@@ -824,7 +824,7 @@ impl<'a> CrateLoader<'a> {
824
824
let mut needs_allocator = attr:: contains_name ( & krate. attrs ,
825
825
"needs_allocator" ) ;
826
826
self . cstore . iter_crate_data ( |_, data| {
827
- needs_allocator = needs_allocator || data. needs_allocator ( ) ;
827
+ needs_allocator = needs_allocator || data. root . needs_allocator ;
828
828
} ) ;
829
829
if !needs_allocator {
830
830
self . sess . injected_allocator . set ( None ) ;
@@ -866,7 +866,7 @@ impl<'a> CrateLoader<'a> {
866
866
None
867
867
} ;
868
868
self . cstore . iter_crate_data ( |_, data| {
869
- if !data. has_global_allocator ( ) {
869
+ if !data. root . has_global_allocator {
870
870
return
871
871
}
872
872
match global_allocator {
@@ -875,14 +875,14 @@ impl<'a> CrateLoader<'a> {
875
875
conflicts with this global \
876
876
allocator in: {}",
877
877
other_crate,
878
- data. name( ) ) ) ;
878
+ data. root . name) ) ;
879
879
}
880
880
Some ( None ) => {
881
881
self . sess . err ( & format ! ( "the #[global_allocator] in this \
882
882
crate conflicts with global \
883
- allocator in: {}", data. name( ) ) ) ;
883
+ allocator in: {}", data. root . name) ) ;
884
884
}
885
- None => global_allocator = Some ( Some ( data. name ( ) ) ) ,
885
+ None => global_allocator = Some ( Some ( data. root . name ) ) ,
886
886
}
887
887
} ) ;
888
888
if global_allocator. is_some ( ) {
@@ -944,7 +944,7 @@ impl<'a> CrateLoader<'a> {
944
944
// error.
945
945
let mut allocator = None ;
946
946
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 {
948
948
allocator = Some ( data. clone ( ) ) ;
949
949
}
950
950
} ) ;
@@ -1020,9 +1020,9 @@ impl<'a> CrateLoader<'a> {
1020
1020
self . sess . err ( & format ! ( "the crate `{}` cannot depend \
1021
1021
on a crate that needs {}, but \
1022
1022
it depends on `{}`",
1023
- self . cstore. get_crate_data( krate) . name( ) ,
1023
+ self . cstore. get_crate_data( krate) . root . name,
1024
1024
what,
1025
- data. name( ) ) ) ;
1025
+ data. root . name) ) ;
1026
1026
}
1027
1027
}
1028
1028
0 commit comments