@@ -58,9 +58,9 @@ pub struct CrateLoader<'a> {
58
58
fn dump_crates ( cstore : & CStore ) {
59
59
info ! ( "resolved crates:" ) ;
60
60
cstore. iter_crate_data ( |_, data| {
61
- info ! ( " name: {}" , data. name( ) ) ;
61
+ info ! ( " name: {}" , data. root . name) ;
62
62
info ! ( " cnum: {}" , data. cnum) ;
63
- info ! ( " hash: {}" , data. hash( ) ) ;
63
+ info ! ( " hash: {}" , data. root . hash) ;
64
64
info ! ( " reqd: {:?}" , * data. dep_kind. lock( ) ) ;
65
65
let CrateSource { dylib, rlib, rmeta } = data. source . clone ( ) ;
66
66
dylib. map ( |dl| info ! ( " dylib: {}" , dl. 0 . display( ) ) ) ;
@@ -113,7 +113,7 @@ impl<'a> CrateLoader<'a> {
113
113
if data. name != name { return }
114
114
115
115
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 }
117
117
Some ( ..) => return ,
118
118
None => { }
119
119
}
@@ -172,9 +172,9 @@ impl<'a> CrateLoader<'a> {
172
172
173
173
// Check for conflicts with any crate loaded so far
174
174
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
178
178
span_fatal ! ( self . sess, span, E0523 ,
179
179
"found two different crates with name `{}` that are \
180
180
not distinguished by differing `-C metadata`. This \
@@ -343,7 +343,7 @@ impl<'a> CrateLoader<'a> {
343
343
if locate_ctxt. triple == & self . sess . opts . target_triple {
344
344
let mut result = LoadResult :: Loaded ( library) ;
345
345
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 {
347
347
assert ! ( locate_ctxt. hash. is_none( ) ) ;
348
348
info ! ( "load success, going to previous cnum: {}" , cnum) ;
349
349
result = LoadResult :: Previous ( cnum) ;
@@ -642,12 +642,12 @@ impl<'a> CrateLoader<'a> {
642
642
643
643
self . cstore . iter_crate_data ( |cnum, data| {
644
644
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 {
647
647
// Inject a dependency from all #![needs_panic_runtime] to this
648
648
// #![panic_runtime] crate.
649
649
self . inject_dependency_if ( cnum, "a panic runtime" ,
650
- & |data| data. needs_panic_runtime ( ) ) ;
650
+ & |data| data. root . needs_panic_runtime ) ;
651
651
runtime_found = runtime_found || * data. dep_kind . lock ( ) == DepKind :: Explicit ;
652
652
}
653
653
} ) ;
@@ -684,19 +684,19 @@ impl<'a> CrateLoader<'a> {
684
684
685
685
// Sanity check the loaded crate to ensure it is indeed a panic runtime
686
686
// and the panic strategy is indeed what we thought it was.
687
- if !data. is_panic_runtime ( ) {
687
+ if !data. root . panic_runtime {
688
688
self . sess . err ( & format ! ( "the crate `{}` is not a panic runtime" ,
689
689
name) ) ;
690
690
}
691
- if data. panic_strategy ( ) != desired_strategy {
691
+ if data. root . panic_strategy != desired_strategy {
692
692
self . sess . err ( & format ! ( "the crate `{}` does not have the panic \
693
693
strategy `{}`",
694
694
name, desired_strategy. desc( ) ) ) ;
695
695
}
696
696
697
697
self . sess . injected_panic_runtime . set ( Some ( cnum) ) ;
698
698
self . inject_dependency_if ( cnum, "a panic runtime" ,
699
- & |data| data. needs_panic_runtime ( ) ) ;
699
+ & |data| data. root . needs_panic_runtime ) ;
700
700
}
701
701
702
702
fn inject_sanitizer_runtime ( & mut self ) {
@@ -791,7 +791,7 @@ impl<'a> CrateLoader<'a> {
791
791
PathKind :: Crate , dep_kind) ;
792
792
793
793
// 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 {
795
795
self . sess . err ( & format ! ( "the crate `{}` is not a sanitizer runtime" ,
796
796
name) ) ;
797
797
}
@@ -814,7 +814,7 @@ impl<'a> CrateLoader<'a> {
814
814
PathKind :: Crate , dep_kind) ;
815
815
816
816
// 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 {
818
818
self . sess . err ( & format ! ( "the crate `profiler_builtins` is not \
819
819
a profiler runtime") ) ;
820
820
}
@@ -831,7 +831,7 @@ impl<'a> CrateLoader<'a> {
831
831
let mut needs_allocator = attr:: contains_name ( & krate. attrs ,
832
832
"needs_allocator" ) ;
833
833
self . cstore . iter_crate_data ( |_, data| {
834
- needs_allocator = needs_allocator || data. needs_allocator ( ) ;
834
+ needs_allocator = needs_allocator || data. root . needs_allocator ;
835
835
} ) ;
836
836
if !needs_allocator {
837
837
self . sess . injected_allocator . set ( None ) ;
@@ -873,7 +873,7 @@ impl<'a> CrateLoader<'a> {
873
873
None
874
874
} ;
875
875
self . cstore . iter_crate_data ( |_, data| {
876
- if !data. has_global_allocator ( ) {
876
+ if !data. root . has_global_allocator {
877
877
return
878
878
}
879
879
match global_allocator {
@@ -882,14 +882,14 @@ impl<'a> CrateLoader<'a> {
882
882
conflicts with this global \
883
883
allocator in: {}",
884
884
other_crate,
885
- data. name( ) ) ) ;
885
+ data. root . name) ) ;
886
886
}
887
887
Some ( None ) => {
888
888
self . sess . err ( & format ! ( "the #[global_allocator] in this \
889
889
crate conflicts with global \
890
- allocator in: {}", data. name( ) ) ) ;
890
+ allocator in: {}", data. root . name) ) ;
891
891
}
892
- None => global_allocator = Some ( Some ( data. name ( ) ) ) ,
892
+ None => global_allocator = Some ( Some ( data. root . name ) ) ,
893
893
}
894
894
} ) ;
895
895
if global_allocator. is_some ( ) {
@@ -951,7 +951,7 @@ impl<'a> CrateLoader<'a> {
951
951
// error.
952
952
let mut allocator = None ;
953
953
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 {
955
955
allocator = Some ( data. clone ( ) ) ;
956
956
}
957
957
} ) ;
@@ -1027,9 +1027,9 @@ impl<'a> CrateLoader<'a> {
1027
1027
self . sess . err ( & format ! ( "the crate `{}` cannot depend \
1028
1028
on a crate that needs {}, but \
1029
1029
it depends on `{}`",
1030
- self . cstore. get_crate_data( krate) . name( ) ,
1030
+ self . cstore. get_crate_data( krate) . root . name,
1031
1031
what,
1032
- data. name( ) ) ) ;
1032
+ data. root . name) ) ;
1033
1033
}
1034
1034
}
1035
1035
0 commit comments