@@ -13,7 +13,7 @@ use rustc_expand::base::SyntaxExtension;
1313use rustc_hir:: def_id:: { CrateNum , LocalDefId , LOCAL_CRATE } ;
1414use rustc_hir:: definitions:: Definitions ;
1515use rustc_index:: vec:: IndexVec ;
16- use rustc_middle:: middle:: cstore:: { CrateSource , DepKind , ExternCrate } ;
16+ use rustc_middle:: middle:: cstore:: { CrateDepKind , CrateSource , ExternCrate } ;
1717use rustc_middle:: middle:: cstore:: { ExternCrateSource , MetadataLoaderDyn } ;
1818use rustc_middle:: ty:: TyCtxt ;
1919use rustc_session:: config:: { self , CrateType , ExternLocation } ;
@@ -294,7 +294,7 @@ impl<'a> CrateLoader<'a> {
294294 host_lib : Option < Library > ,
295295 root : Option < & CratePaths > ,
296296 lib : Library ,
297- dep_kind : DepKind ,
297+ dep_kind : CrateDepKind ,
298298 name : Symbol ,
299299 ) -> Result < CrateNum , CrateError > {
300300 let _prof_timer = self . sess . prof . generic_activity ( "metadata_register_crate" ) ;
@@ -425,7 +425,7 @@ impl<'a> CrateLoader<'a> {
425425 & ' b mut self ,
426426 name : Symbol ,
427427 span : Span ,
428- dep_kind : DepKind ,
428+ dep_kind : CrateDepKind ,
429429 dep : Option < ( & ' b CratePaths , & ' b CrateDep ) > ,
430430 ) -> CrateNum {
431431 if dep. is_none ( ) {
@@ -438,7 +438,7 @@ impl<'a> CrateLoader<'a> {
438438 fn maybe_resolve_crate < ' b > (
439439 & ' b mut self ,
440440 name : Symbol ,
441- mut dep_kind : DepKind ,
441+ mut dep_kind : CrateDepKind ,
442442 dep : Option < ( & ' b CratePaths , & ' b CrateDep ) > ,
443443 ) -> Result < CrateNum , CrateError > {
444444 info ! ( "resolving crate `{}`" , name) ;
@@ -475,7 +475,7 @@ impl<'a> CrateLoader<'a> {
475475 match self . load ( & mut locator) ? {
476476 Some ( res) => ( res, None ) ,
477477 None => {
478- dep_kind = DepKind :: MacrosOnly ;
478+ dep_kind = CrateDepKind :: MacrosOnly ;
479479 match self . load_proc_macro ( & mut locator, path_kind) ? {
480480 Some ( res) => res,
481481 None => return Err ( locator. into_error ( ) ) ,
@@ -488,7 +488,7 @@ impl<'a> CrateLoader<'a> {
488488 ( LoadResult :: Previous ( cnum) , None ) => {
489489 let data = self . cstore . get_crate_data ( cnum) ;
490490 if data. is_proc_macro_crate ( ) {
491- dep_kind = DepKind :: MacrosOnly ;
491+ dep_kind = CrateDepKind :: MacrosOnly ;
492492 }
493493 data. update_dep_kind ( |data_dep_kind| cmp:: max ( data_dep_kind, dep_kind) ) ;
494494 Ok ( cnum)
@@ -548,7 +548,7 @@ impl<'a> CrateLoader<'a> {
548548 crate_root : & CrateRoot < ' _ > ,
549549 metadata : & MetadataBlob ,
550550 krate : CrateNum ,
551- dep_kind : DepKind ,
551+ dep_kind : CrateDepKind ,
552552 ) -> Result < CrateNumMap , CrateError > {
553553 debug ! ( "resolving deps of external crate" ) ;
554554 if crate_root. is_proc_macro_crate ( ) {
@@ -567,7 +567,7 @@ impl<'a> CrateLoader<'a> {
567567 dep. name, dep. hash, dep. extra_filename
568568 ) ;
569569 let dep_kind = match dep_kind {
570- DepKind :: MacrosOnly => DepKind :: MacrosOnly ,
570+ CrateDepKind :: MacrosOnly => CrateDepKind :: MacrosOnly ,
571571 _ => dep. kind ,
572572 } ;
573573 let cnum = self . maybe_resolve_crate ( dep. name , dep_kind, Some ( ( root, & dep) ) ) ?;
@@ -634,7 +634,7 @@ impl<'a> CrateLoader<'a> {
634634 self . inject_dependency_if ( cnum, "a panic runtime" , & |data| {
635635 data. needs_panic_runtime ( )
636636 } ) ;
637- runtime_found = runtime_found || data. dep_kind ( ) == DepKind :: Explicit ;
637+ runtime_found = runtime_found || data. dep_kind ( ) == CrateDepKind :: Explicit ;
638638 }
639639 } ) ;
640640
@@ -663,7 +663,7 @@ impl<'a> CrateLoader<'a> {
663663 } ;
664664 info ! ( "panic runtime not found -- loading {}" , name) ;
665665
666- let cnum = self . resolve_crate ( name, DUMMY_SP , DepKind :: Implicit , None ) ;
666+ let cnum = self . resolve_crate ( name, DUMMY_SP , CrateDepKind :: Implicit , None ) ;
667667 let data = self . cstore . get_crate_data ( cnum) ;
668668
669669 // Sanity check the loaded crate to ensure it is indeed a panic runtime
@@ -693,7 +693,7 @@ impl<'a> CrateLoader<'a> {
693693 info ! ( "loading profiler" ) ;
694694
695695 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 ) ;
697697 let data = self . cstore . get_crate_data ( cnum) ;
698698
699699 // Sanity check the loaded crate to ensure it is indeed a profiler runtime
@@ -891,9 +891,9 @@ impl<'a> CrateLoader<'a> {
891891 None => item. ident . name ,
892892 } ;
893893 let dep_kind = if attr:: contains_name ( & item. attrs , sym:: no_link) {
894- DepKind :: MacrosOnly
894+ CrateDepKind :: MacrosOnly
895895 } else {
896- DepKind :: Explicit
896+ CrateDepKind :: Explicit
897897 } ;
898898
899899 let cnum = self . resolve_crate ( name, item. span , dep_kind, None ) ;
@@ -915,7 +915,7 @@ impl<'a> CrateLoader<'a> {
915915 }
916916
917917 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 ) ;
919919
920920 self . update_extern_crate (
921921 cnum,
@@ -932,6 +932,6 @@ impl<'a> CrateLoader<'a> {
932932 }
933933
934934 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 ( )
936936 }
937937}
0 commit comments