mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Make tcx.stable_crate_id() faster
This commit is contained in:
parent
e95bd03f01
commit
ca935ddbf1
@ -1299,8 +1299,12 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn stable_crate_id(self, cnum: CrateNum) -> StableCrateId {
|
pub fn stable_crate_id(self, crate_num: CrateNum) -> StableCrateId {
|
||||||
self.def_path_hash(cnum.as_def_id()).stable_crate_id()
|
if crate_num == LOCAL_CRATE {
|
||||||
|
self.sess.local_stable_crate_id()
|
||||||
|
} else {
|
||||||
|
self.cstore.stable_crate_id_untracked(crate_num)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn def_path_debug_str(self, def_id: DefId) -> String {
|
pub fn def_path_debug_str(self, def_id: DefId) -> String {
|
||||||
|
Loading…
Reference in New Issue
Block a user