@@ -13,7 +13,7 @@ use rustc_expand::base::SyntaxExtension;
13
13
use rustc_hir:: def_id:: { CrateNum , LocalDefId , LOCAL_CRATE } ;
14
14
use rustc_hir:: definitions:: Definitions ;
15
15
use rustc_index:: vec:: IndexVec ;
16
- use rustc_middle:: middle:: cstore:: { CrateSource , DepKind , ExternCrate } ;
16
+ use rustc_middle:: middle:: cstore:: { CrateDepKind , CrateSource , ExternCrate } ;
17
17
use rustc_middle:: middle:: cstore:: { ExternCrateSource , MetadataLoaderDyn } ;
18
18
use rustc_middle:: ty:: TyCtxt ;
19
19
use rustc_session:: config:: { self , CrateType , ExternLocation } ;
@@ -294,7 +294,7 @@ impl<'a> CrateLoader<'a> {
294
294
host_lib : Option < Library > ,
295
295
root : Option < & CratePaths > ,
296
296
lib : Library ,
297
- dep_kind : DepKind ,
297
+ dep_kind : CrateDepKind ,
298
298
name : Symbol ,
299
299
) -> Result < CrateNum , CrateError > {
300
300
let _prof_timer = self . sess . prof . generic_activity ( "metadata_register_crate" ) ;
@@ -425,7 +425,7 @@ impl<'a> CrateLoader<'a> {
425
425
& ' b mut self ,
426
426
name : Symbol ,
427
427
span : Span ,
428
- dep_kind : DepKind ,
428
+ dep_kind : CrateDepKind ,
429
429
dep : Option < ( & ' b CratePaths , & ' b CrateDep ) > ,
430
430
) -> CrateNum {
431
431
if dep. is_none ( ) {
@@ -438,7 +438,7 @@ impl<'a> CrateLoader<'a> {
438
438
fn maybe_resolve_crate < ' b > (
439
439
& ' b mut self ,
440
440
name : Symbol ,
441
- mut dep_kind : DepKind ,
441
+ mut dep_kind : CrateDepKind ,
442
442
dep : Option < ( & ' b CratePaths , & ' b CrateDep ) > ,
443
443
) -> Result < CrateNum , CrateError > {
444
444
info ! ( "resolving crate `{}`" , name) ;
@@ -475,7 +475,7 @@ impl<'a> CrateLoader<'a> {
475
475
match self . load ( & mut locator) ? {
476
476
Some ( res) => ( res, None ) ,
477
477
None => {
478
- dep_kind = DepKind :: MacrosOnly ;
478
+ dep_kind = CrateDepKind :: MacrosOnly ;
479
479
match self . load_proc_macro ( & mut locator, path_kind) ? {
480
480
Some ( res) => res,
481
481
None => return Err ( locator. into_error ( ) ) ,
@@ -488,7 +488,7 @@ impl<'a> CrateLoader<'a> {
488
488
( LoadResult :: Previous ( cnum) , None ) => {
489
489
let data = self . cstore . get_crate_data ( cnum) ;
490
490
if data. is_proc_macro_crate ( ) {
491
- dep_kind = DepKind :: MacrosOnly ;
491
+ dep_kind = CrateDepKind :: MacrosOnly ;
492
492
}
493
493
data. update_dep_kind ( |data_dep_kind| cmp:: max ( data_dep_kind, dep_kind) ) ;
494
494
Ok ( cnum)
@@ -548,7 +548,7 @@ impl<'a> CrateLoader<'a> {
548
548
crate_root : & CrateRoot < ' _ > ,
549
549
metadata : & MetadataBlob ,
550
550
krate : CrateNum ,
551
- dep_kind : DepKind ,
551
+ dep_kind : CrateDepKind ,
552
552
) -> Result < CrateNumMap , CrateError > {
553
553
debug ! ( "resolving deps of external crate" ) ;
554
554
if crate_root. is_proc_macro_crate ( ) {
@@ -567,7 +567,7 @@ impl<'a> CrateLoader<'a> {
567
567
dep. name, dep. hash, dep. extra_filename
568
568
) ;
569
569
let dep_kind = match dep_kind {
570
- DepKind :: MacrosOnly => DepKind :: MacrosOnly ,
570
+ CrateDepKind :: MacrosOnly => CrateDepKind :: MacrosOnly ,
571
571
_ => dep. kind ,
572
572
} ;
573
573
let cnum = self . maybe_resolve_crate ( dep. name , dep_kind, Some ( ( root, & dep) ) ) ?;
@@ -634,7 +634,7 @@ impl<'a> CrateLoader<'a> {
634
634
self . inject_dependency_if ( cnum, "a panic runtime" , & |data| {
635
635
data. needs_panic_runtime ( )
636
636
} ) ;
637
- runtime_found = runtime_found || data. dep_kind ( ) == DepKind :: Explicit ;
637
+ runtime_found = runtime_found || data. dep_kind ( ) == CrateDepKind :: Explicit ;
638
638
}
639
639
} ) ;
640
640
@@ -663,7 +663,7 @@ impl<'a> CrateLoader<'a> {
663
663
} ;
664
664
info ! ( "panic runtime not found -- loading {}" , name) ;
665
665
666
- let cnum = self . resolve_crate ( name, DUMMY_SP , DepKind :: Implicit , None ) ;
666
+ let cnum = self . resolve_crate ( name, DUMMY_SP , CrateDepKind :: Implicit , None ) ;
667
667
let data = self . cstore . get_crate_data ( cnum) ;
668
668
669
669
// Sanity check the loaded crate to ensure it is indeed a panic runtime
@@ -693,7 +693,7 @@ impl<'a> CrateLoader<'a> {
693
693
info ! ( "loading profiler" ) ;
694
694
695
695
let name = sym:: profiler_builtins;
696
- let cnum = self . resolve_crate ( name, DUMMY_SP , DepKind :: Implicit , None ) ;
696
+ let cnum = self . resolve_crate ( name, DUMMY_SP , CrateDepKind :: Implicit , None ) ;
697
697
let data = self . cstore . get_crate_data ( cnum) ;
698
698
699
699
// Sanity check the loaded crate to ensure it is indeed a profiler runtime
@@ -891,9 +891,9 @@ impl<'a> CrateLoader<'a> {
891
891
None => item. ident . name ,
892
892
} ;
893
893
let dep_kind = if attr:: contains_name ( & item. attrs , sym:: no_link) {
894
- DepKind :: MacrosOnly
894
+ CrateDepKind :: MacrosOnly
895
895
} else {
896
- DepKind :: Explicit
896
+ CrateDepKind :: Explicit
897
897
} ;
898
898
899
899
let cnum = self . resolve_crate ( name, item. span , dep_kind, None ) ;
@@ -915,7 +915,7 @@ impl<'a> CrateLoader<'a> {
915
915
}
916
916
917
917
pub fn process_path_extern ( & mut self , name : Symbol , span : Span ) -> CrateNum {
918
- let cnum = self . resolve_crate ( name, span, DepKind :: Explicit , None ) ;
918
+ let cnum = self . resolve_crate ( name, span, CrateDepKind :: Explicit , None ) ;
919
919
920
920
self . update_extern_crate (
921
921
cnum,
@@ -932,6 +932,6 @@ impl<'a> CrateLoader<'a> {
932
932
}
933
933
934
934
pub fn maybe_process_path_extern ( & mut self , name : Symbol ) -> Option < CrateNum > {
935
- self . maybe_resolve_crate ( name, DepKind :: Explicit , None ) . ok ( )
935
+ self . maybe_resolve_crate ( name, CrateDepKind :: Explicit , None ) . ok ( )
936
936
}
937
937
}
0 commit comments