@@ -30,6 +30,7 @@ use syntax_expand::base::{SyntaxExtensionKind, SyntaxExtension};
3030use syntax_expand:: proc_macro:: { AttrProcMacro , ProcMacroDerive , BangProcMacro } ;
3131use syntax_pos:: { self , Span , Pos , DUMMY_SP , hygiene:: MacroKind } ;
3232use syntax_pos:: symbol:: { Symbol , sym} ;
33+ use std:: cmp;
3334
3435pub use crate :: cstore_impl:: { provide, provide_extern} ;
3536
@@ -96,7 +97,7 @@ crate struct CrateMetadata {
9697 /// Same ID set as `cnum_map` plus maybe some injected crates like panic runtime.
9798 crate dependencies : Lock < Vec < CrateNum > > ,
9899 /// How to link (or not link) this crate to the currently compiled crate.
99- crate dep_kind : Lock < DepKind > ,
100+ dep_kind : Lock < DepKind > ,
100101 /// Filesystem location of this crate.
101102 crate source : CrateSource ,
102103 /// Whether or not this crate should be consider a private dependency
@@ -446,6 +447,23 @@ impl<'a, 'tcx> CrateMetadata {
446447 }
447448 }
448449
450+ crate fn get_dep_kind ( & self ) -> DepKind {
451+ * self . dep_kind . lock ( )
452+ }
453+
454+ crate fn export_macros_untracked ( & self ) {
455+ let mut dep_kind = self . dep_kind . lock ( ) ;
456+ if * dep_kind == DepKind :: UnexportedMacrosOnly {
457+ * dep_kind = DepKind :: MacrosOnly ;
458+ }
459+ }
460+
461+ crate fn set_max_dep_kind ( & self , dep_kind : DepKind ) {
462+ self . dep_kind . with_lock ( |data_dep_kind| {
463+ * data_dep_kind = cmp:: max ( * data_dep_kind, dep_kind) ;
464+ } ) ;
465+ }
466+
449467 /// Iterates over the diagnostic items in the given crate.
450468 crate fn get_diagnostic_items (
451469 & self ,
0 commit comments