@@ -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 } ;
@@ -306,7 +306,7 @@ impl<'a> CrateLoader<'a> {
306
306
host_lib : Option < Library > ,
307
307
root : Option < & CratePaths > ,
308
308
lib : Library ,
309
- dep_kind : DepKind ,
309
+ dep_kind : CrateDepKind ,
310
310
name : Symbol ,
311
311
) -> Result < CrateNum , CrateError > {
312
312
let _prof_timer = self . sess . prof . generic_activity ( "metadata_register_crate" ) ;
@@ -437,7 +437,7 @@ impl<'a> CrateLoader<'a> {
437
437
& ' b mut self ,
438
438
name : Symbol ,
439
439
span : Span ,
440
- dep_kind : DepKind ,
440
+ dep_kind : CrateDepKind ,
441
441
dep : Option < ( & ' b CratePaths , & ' b CrateDep ) > ,
442
442
) -> CrateNum {
443
443
if dep. is_none ( ) {
@@ -450,7 +450,7 @@ impl<'a> CrateLoader<'a> {
450
450
fn maybe_resolve_crate < ' b > (
451
451
& ' b mut self ,
452
452
name : Symbol ,
453
- mut dep_kind : DepKind ,
453
+ mut dep_kind : CrateDepKind ,
454
454
dep : Option < ( & ' b CratePaths , & ' b CrateDep ) > ,
455
455
) -> Result < CrateNum , CrateError > {
456
456
info ! ( "resolving crate `{}`" , name) ;
@@ -487,7 +487,7 @@ impl<'a> CrateLoader<'a> {
487
487
match self . load ( & mut locator) ? {
488
488
Some ( res) => ( res, None ) ,
489
489
None => {
490
- dep_kind = DepKind :: MacrosOnly ;
490
+ dep_kind = CrateDepKind :: MacrosOnly ;
491
491
match self . load_proc_macro ( & mut locator, path_kind) ? {
492
492
Some ( res) => res,
493
493
None => return Err ( locator. into_error ( ) ) ,
@@ -500,7 +500,7 @@ impl<'a> CrateLoader<'a> {
500
500
( LoadResult :: Previous ( cnum) , None ) => {
501
501
let data = self . cstore . get_crate_data ( cnum) ;
502
502
if data. is_proc_macro_crate ( ) {
503
- dep_kind = DepKind :: MacrosOnly ;
503
+ dep_kind = CrateDepKind :: MacrosOnly ;
504
504
}
505
505
data. update_dep_kind ( |data_dep_kind| cmp:: max ( data_dep_kind, dep_kind) ) ;
506
506
Ok ( cnum)
@@ -560,7 +560,7 @@ impl<'a> CrateLoader<'a> {
560
560
crate_root : & CrateRoot < ' _ > ,
561
561
metadata : & MetadataBlob ,
562
562
krate : CrateNum ,
563
- dep_kind : DepKind ,
563
+ dep_kind : CrateDepKind ,
564
564
) -> Result < CrateNumMap , CrateError > {
565
565
debug ! ( "resolving deps of external crate" ) ;
566
566
if crate_root. is_proc_macro_crate ( ) {
@@ -579,7 +579,7 @@ impl<'a> CrateLoader<'a> {
579
579
dep. name, dep. hash, dep. extra_filename
580
580
) ;
581
581
let dep_kind = match dep_kind {
582
- DepKind :: MacrosOnly => DepKind :: MacrosOnly ,
582
+ CrateDepKind :: MacrosOnly => CrateDepKind :: MacrosOnly ,
583
583
_ => dep. kind ,
584
584
} ;
585
585
let cnum = self . maybe_resolve_crate ( dep. name , dep_kind, Some ( ( root, & dep) ) ) ?;
@@ -646,7 +646,7 @@ impl<'a> CrateLoader<'a> {
646
646
self . inject_dependency_if ( cnum, "a panic runtime" , & |data| {
647
647
data. needs_panic_runtime ( )
648
648
} ) ;
649
- runtime_found = runtime_found || data. dep_kind ( ) == DepKind :: Explicit ;
649
+ runtime_found = runtime_found || data. dep_kind ( ) == CrateDepKind :: Explicit ;
650
650
}
651
651
} ) ;
652
652
@@ -675,7 +675,7 @@ impl<'a> CrateLoader<'a> {
675
675
} ;
676
676
info ! ( "panic runtime not found -- loading {}" , name) ;
677
677
678
- let cnum = self . resolve_crate ( name, DUMMY_SP , DepKind :: Implicit , None ) ;
678
+ let cnum = self . resolve_crate ( name, DUMMY_SP , CrateDepKind :: Implicit , None ) ;
679
679
let data = self . cstore . get_crate_data ( cnum) ;
680
680
681
681
// Sanity check the loaded crate to ensure it is indeed a panic runtime
@@ -705,7 +705,7 @@ impl<'a> CrateLoader<'a> {
705
705
info ! ( "loading profiler" ) ;
706
706
707
707
let name = sym:: profiler_builtins;
708
- let cnum = self . resolve_crate ( name, DUMMY_SP , DepKind :: Implicit , None ) ;
708
+ let cnum = self . resolve_crate ( name, DUMMY_SP , CrateDepKind :: Implicit , None ) ;
709
709
let data = self . cstore . get_crate_data ( cnum) ;
710
710
711
711
// Sanity check the loaded crate to ensure it is indeed a profiler runtime
@@ -901,9 +901,9 @@ impl<'a> CrateLoader<'a> {
901
901
None => item. ident . name ,
902
902
} ;
903
903
let dep_kind = if attr:: contains_name ( & item. attrs , sym:: no_link) {
904
- DepKind :: MacrosOnly
904
+ CrateDepKind :: MacrosOnly
905
905
} else {
906
- DepKind :: Explicit
906
+ CrateDepKind :: Explicit
907
907
} ;
908
908
909
909
let cnum = self . resolve_crate ( name, item. span , dep_kind, None ) ;
@@ -925,7 +925,7 @@ impl<'a> CrateLoader<'a> {
925
925
}
926
926
927
927
pub fn process_path_extern ( & mut self , name : Symbol , span : Span ) -> CrateNum {
928
- let cnum = self . resolve_crate ( name, span, DepKind :: Explicit , None ) ;
928
+ let cnum = self . resolve_crate ( name, span, CrateDepKind :: Explicit , None ) ;
929
929
930
930
self . update_extern_crate (
931
931
cnum,
@@ -942,6 +942,6 @@ impl<'a> CrateLoader<'a> {
942
942
}
943
943
944
944
pub fn maybe_process_path_extern ( & mut self , name : Symbol ) -> Option < CrateNum > {
945
- self . maybe_resolve_crate ( name, DepKind :: Explicit , None ) . ok ( )
945
+ self . maybe_resolve_crate ( name, CrateDepKind :: Explicit , None ) . ok ( )
946
946
}
947
947
}
0 commit comments