@@ -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 } ;
@@ -306,7 +306,7 @@ impl<'a> CrateLoader<'a> {
306306 host_lib : Option < Library > ,
307307 root : Option < & CratePaths > ,
308308 lib : Library ,
309- dep_kind : DepKind ,
309+ dep_kind : CrateDepKind ,
310310 name : Symbol ,
311311 ) -> Result < CrateNum , CrateError > {
312312 let _prof_timer = self . sess . prof . generic_activity ( "metadata_register_crate" ) ;
@@ -437,7 +437,7 @@ impl<'a> CrateLoader<'a> {
437437 & ' b mut self ,
438438 name : Symbol ,
439439 span : Span ,
440- dep_kind : DepKind ,
440+ dep_kind : CrateDepKind ,
441441 dep : Option < ( & ' b CratePaths , & ' b CrateDep ) > ,
442442 ) -> CrateNum {
443443 if dep. is_none ( ) {
@@ -450,7 +450,7 @@ impl<'a> CrateLoader<'a> {
450450 fn maybe_resolve_crate < ' b > (
451451 & ' b mut self ,
452452 name : Symbol ,
453- mut dep_kind : DepKind ,
453+ mut dep_kind : CrateDepKind ,
454454 dep : Option < ( & ' b CratePaths , & ' b CrateDep ) > ,
455455 ) -> Result < CrateNum , CrateError > {
456456 info ! ( "resolving crate `{}`" , name) ;
@@ -487,7 +487,7 @@ impl<'a> CrateLoader<'a> {
487487 match self . load ( & mut locator) ? {
488488 Some ( res) => ( res, None ) ,
489489 None => {
490- dep_kind = DepKind :: MacrosOnly ;
490+ dep_kind = CrateDepKind :: MacrosOnly ;
491491 match self . load_proc_macro ( & mut locator, path_kind) ? {
492492 Some ( res) => res,
493493 None => return Err ( locator. into_error ( ) ) ,
@@ -500,7 +500,7 @@ impl<'a> CrateLoader<'a> {
500500 ( LoadResult :: Previous ( cnum) , None ) => {
501501 let data = self . cstore . get_crate_data ( cnum) ;
502502 if data. is_proc_macro_crate ( ) {
503- dep_kind = DepKind :: MacrosOnly ;
503+ dep_kind = CrateDepKind :: MacrosOnly ;
504504 }
505505 data. update_dep_kind ( |data_dep_kind| cmp:: max ( data_dep_kind, dep_kind) ) ;
506506 Ok ( cnum)
@@ -560,7 +560,7 @@ impl<'a> CrateLoader<'a> {
560560 crate_root : & CrateRoot < ' _ > ,
561561 metadata : & MetadataBlob ,
562562 krate : CrateNum ,
563- dep_kind : DepKind ,
563+ dep_kind : CrateDepKind ,
564564 ) -> Result < CrateNumMap , CrateError > {
565565 debug ! ( "resolving deps of external crate" ) ;
566566 if crate_root. is_proc_macro_crate ( ) {
@@ -579,7 +579,7 @@ impl<'a> CrateLoader<'a> {
579579 dep. name, dep. hash, dep. extra_filename
580580 ) ;
581581 let dep_kind = match dep_kind {
582- DepKind :: MacrosOnly => DepKind :: MacrosOnly ,
582+ CrateDepKind :: MacrosOnly => CrateDepKind :: MacrosOnly ,
583583 _ => dep. kind ,
584584 } ;
585585 let cnum = self . maybe_resolve_crate ( dep. name , dep_kind, Some ( ( root, & dep) ) ) ?;
@@ -646,7 +646,7 @@ impl<'a> CrateLoader<'a> {
646646 self . inject_dependency_if ( cnum, "a panic runtime" , & |data| {
647647 data. needs_panic_runtime ( )
648648 } ) ;
649- runtime_found = runtime_found || data. dep_kind ( ) == DepKind :: Explicit ;
649+ runtime_found = runtime_found || data. dep_kind ( ) == CrateDepKind :: Explicit ;
650650 }
651651 } ) ;
652652
@@ -675,7 +675,7 @@ impl<'a> CrateLoader<'a> {
675675 } ;
676676 info ! ( "panic runtime not found -- loading {}" , name) ;
677677
678- let cnum = self . resolve_crate ( name, DUMMY_SP , DepKind :: Implicit , None ) ;
678+ let cnum = self . resolve_crate ( name, DUMMY_SP , CrateDepKind :: Implicit , None ) ;
679679 let data = self . cstore . get_crate_data ( cnum) ;
680680
681681 // Sanity check the loaded crate to ensure it is indeed a panic runtime
@@ -705,7 +705,7 @@ impl<'a> CrateLoader<'a> {
705705 info ! ( "loading profiler" ) ;
706706
707707 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 ) ;
709709 let data = self . cstore . get_crate_data ( cnum) ;
710710
711711 // Sanity check the loaded crate to ensure it is indeed a profiler runtime
@@ -901,9 +901,9 @@ impl<'a> CrateLoader<'a> {
901901 None => item. ident . name ,
902902 } ;
903903 let dep_kind = if attr:: contains_name ( & item. attrs , sym:: no_link) {
904- DepKind :: MacrosOnly
904+ CrateDepKind :: MacrosOnly
905905 } else {
906- DepKind :: Explicit
906+ CrateDepKind :: Explicit
907907 } ;
908908
909909 let cnum = self . resolve_crate ( name, item. span , dep_kind, None ) ;
@@ -925,7 +925,7 @@ impl<'a> CrateLoader<'a> {
925925 }
926926
927927 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 ) ;
929929
930930 self . update_extern_crate (
931931 cnum,
@@ -942,6 +942,6 @@ impl<'a> CrateLoader<'a> {
942942 }
943943
944944 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 ( )
946946 }
947947}
0 commit comments