Auto merge of #119259 - cjgillot:single-crate-id, r=Mark-Simulacrum
Only store StableCrateId once in DefPathTable. https://github.com/rust-lang/rust/pull/119238 made me think of this. cc `@Mark-Simulacrum`
This commit is contained in:
commit
dc450f9dcb
4 changed files with 40 additions and 32 deletions
|
@ -19,7 +19,9 @@ impl DefPathHashMapRef<'_> {
|
|||
#[inline]
|
||||
pub fn def_path_hash_to_def_index(&self, def_path_hash: &DefPathHash) -> DefIndex {
|
||||
match *self {
|
||||
DefPathHashMapRef::OwnedFromMetadata(ref map) => map.get(def_path_hash).unwrap(),
|
||||
DefPathHashMapRef::OwnedFromMetadata(ref map) => {
|
||||
map.get(&def_path_hash.local_hash()).unwrap()
|
||||
}
|
||||
DefPathHashMapRef::BorrowedFromTcx(_) => {
|
||||
panic!("DefPathHashMap::BorrowedFromTcx variant only exists for serialization")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue