Revert "Reduce the amount of untracked state in TyCtxt"

This commit is contained in:
Camille Gillot
2021-06-01 09:05:22 +02:00
committed by GitHub
parent c9c1f8be3f
commit 0f0f3138cb
49 changed files with 255 additions and 234 deletions

View File

@@ -182,7 +182,7 @@ pub type MetadataLoaderDyn = dyn MetadataLoader + Sync;
/// that it's *not* tracked for dependency information throughout compilation
/// (it'd break incremental compilation) and should only be called pre-HIR (e.g.
/// during resolve)
pub trait CrateStore: std::fmt::Debug {
pub trait CrateStore {
fn as_any(&self) -> &dyn Any;
// resolve
@@ -199,6 +199,7 @@ pub trait CrateStore: std::fmt::Debug {
// "queries" used in resolve that aren't tracked for incremental compilation
fn crate_name_untracked(&self, cnum: CrateNum) -> Symbol;
fn crate_is_private_dep_untracked(&self, cnum: CrateNum) -> bool;
fn stable_crate_id_untracked(&self, cnum: CrateNum) -> StableCrateId;
fn crate_hash_untracked(&self, cnum: CrateNum) -> Svh;
@@ -208,6 +209,7 @@ pub trait CrateStore: std::fmt::Debug {
// utility functions
fn encode_metadata(&self, tcx: TyCtxt<'_>) -> EncodedMetadata;
fn metadata_encoding_version(&self) -> &[u8];
fn allocator_kind(&self) -> Option<AllocatorKind>;
}

View File

@@ -49,7 +49,7 @@ impl<'tcx> ExportedSymbol<'tcx> {
pub fn metadata_symbol_name(tcx: TyCtxt<'_>) -> String {
format!(
"rust_metadata_{}_{:08x}",
tcx.crate_name(LOCAL_CRATE),
tcx.original_crate_name(LOCAL_CRATE),
tcx.sess.local_stable_crate_id().to_u64(),
)
}