@@ -47,9 +47,9 @@ pub struct CrateLoader<'a> {
47
47
fn dump_crates ( cstore : & CStore ) {
48
48
info ! ( "resolved crates:" ) ;
49
49
cstore. iter_crate_data ( |cnum, data| {
50
- info ! ( " name: {}" , data. root . name( ) ) ;
50
+ info ! ( " name: {}" , data. name( ) ) ;
51
51
info ! ( " cnum: {}" , cnum) ;
52
- info ! ( " hash: {}" , data. root . hash( ) ) ;
52
+ info ! ( " hash: {}" , data. hash( ) ) ;
53
53
info ! ( " reqd: {:?}" , data. dep_kind( ) ) ;
54
54
let CrateSource { dylib, rlib, rmeta } = data. source ( ) ;
55
55
dylib. as_ref ( ) . map ( |dl| info ! ( " dylib: {}" , dl. 0 . display( ) ) ) ;
@@ -101,10 +101,10 @@ impl<'a> CrateLoader<'a> {
101
101
-> Option < CrateNum > {
102
102
let mut ret = None ;
103
103
self . cstore . iter_crate_data ( |cnum, data| {
104
- if data. root . name ( ) != name { return }
104
+ if data. name ( ) != name { return }
105
105
106
106
match hash {
107
- Some ( hash) if * hash == data. root . hash ( ) => { ret = Some ( cnum) ; return }
107
+ Some ( hash) if * hash == data. hash ( ) => { ret = Some ( cnum) ; return }
108
108
Some ( ..) => return ,
109
109
None => { }
110
110
}
@@ -164,9 +164,9 @@ impl<'a> CrateLoader<'a> {
164
164
165
165
// Check for conflicts with any crate loaded so far
166
166
self . cstore . iter_crate_data ( |_, other| {
167
- if other. root . name ( ) == root. name ( ) && // same crate-name
168
- other. root . disambiguator ( ) == root. disambiguator ( ) && // same crate-disambiguator
169
- other. root . hash ( ) != root. hash ( ) { // but different SVH
167
+ if other. name ( ) == root. name ( ) && // same crate-name
168
+ other. disambiguator ( ) == root. disambiguator ( ) && // same crate-disambiguator
169
+ other. hash ( ) != root. hash ( ) { // but different SVH
170
170
span_fatal ! ( self . sess, span, E0523 ,
171
171
"found two different crates with name `{}` that are \
172
172
not distinguished by differing `-C metadata`. This \
@@ -350,7 +350,7 @@ impl<'a> CrateLoader<'a> {
350
350
match result {
351
351
( LoadResult :: Previous ( cnum) , None ) => {
352
352
let data = self . cstore . get_crate_data ( cnum) ;
353
- if data. root . is_proc_macro_crate ( ) {
353
+ if data. is_proc_macro_crate ( ) {
354
354
dep_kind = DepKind :: UnexportedMacrosOnly ;
355
355
}
356
356
data. update_dep_kind ( |data_dep_kind| cmp:: max ( data_dep_kind, dep_kind) ) ;
@@ -378,7 +378,7 @@ impl<'a> CrateLoader<'a> {
378
378
if locator. triple == self . sess . opts . target_triple {
379
379
let mut result = LoadResult :: Loaded ( library) ;
380
380
self . cstore . iter_crate_data ( |cnum, data| {
381
- if data. root . name ( ) == root. name ( ) && root. hash ( ) == data. root . hash ( ) {
381
+ if data. name ( ) == root. name ( ) && root. hash ( ) == data. hash ( ) {
382
382
assert ! ( locator. hash. is_none( ) ) ;
383
383
info ! ( "load success, going to previous cnum: {}" , cnum) ;
384
384
result = LoadResult :: Previous ( cnum) ;
@@ -621,7 +621,7 @@ impl<'a> CrateLoader<'a> {
621
621
622
622
let mut uses_std = false ;
623
623
self . cstore . iter_crate_data ( |_, data| {
624
- if data. root . name ( ) == sym:: std {
624
+ if data. name ( ) == sym:: std {
625
625
uses_std = true ;
626
626
}
627
627
} ) ;
@@ -731,14 +731,14 @@ impl<'a> CrateLoader<'a> {
731
731
conflicts with this global \
732
732
allocator in: {}",
733
733
other_crate,
734
- data. root . name( ) ) ) ;
734
+ data. name( ) ) ) ;
735
735
}
736
736
Some ( None ) => {
737
737
self . sess . err ( & format ! ( "the `#[global_allocator]` in this \
738
738
crate conflicts with global \
739
- allocator in: {}", data. root . name( ) ) ) ;
739
+ allocator in: {}", data. name( ) ) ) ;
740
740
}
741
- None => global_allocator = Some ( Some ( data. root . name ( ) ) ) ,
741
+ None => global_allocator = Some ( Some ( data. name ( ) ) ) ,
742
742
}
743
743
} ) ;
744
744
if global_allocator. is_some ( ) {
@@ -786,9 +786,9 @@ impl<'a> CrateLoader<'a> {
786
786
self . sess . err ( & format ! ( "the crate `{}` cannot depend \
787
787
on a crate that needs {}, but \
788
788
it depends on `{}`",
789
- self . cstore. get_crate_data( krate) . root . name( ) ,
789
+ self . cstore. get_crate_data( krate) . name( ) ,
790
790
what,
791
- data. root . name( ) ) ) ;
791
+ data. name( ) ) ) ;
792
792
}
793
793
}
794
794
0 commit comments