/// Used for decoding interpret::AllocIds in a cached & thread-safe manner.
pub alloc_decoding_state: AllocDecodingState,
- pub root: schema::CrateRoot,
+ // NOTE(eddyb) we pass `'static` to a `'tcx` parameter because this
+ // lifetime is only used behind `Lazy` / `LazySeq`, and therefore
+ // acts like an universal (`for<'tcx>`), that is paired up with
+ // whichever `TyCtxt` is being used to decode those values.
+ pub root: schema::CrateRoot<'static>,
/// For each public item in this crate, we encode a key. When the
/// crate is loaded, we read all the keys and put them in this
pub source: CrateSource,
pub proc_macros: Option<Vec<(ast::Name, Lrc<SyntaxExtension>)>>,
+
+ /// Whether or not this crate should be consider a private dependency
+ /// for purposes of the 'exported_private_dependencies' lint
+ pub private_dep: bool
}
pub struct CStore {
}
pub(super) fn get_crate_data(&self, cnum: CrateNum) -> Lrc<CrateMetadata> {
- self.metas.borrow()[cnum].clone().unwrap()
+ self.metas.borrow()[cnum].clone()
+ .unwrap_or_else(|| panic!("Failed to get crate data for {:?}", cnum))
}
pub(super) fn set_crate_data(&self, cnum: CrateNum, data: Lrc<CrateMetadata>) {