@@ -42,19 +42,20 @@ impl DefPathTable {
4242 fn allocate ( & mut self , key : DefKey , def_path_hash : DefPathHash ) -> DefIndex {
4343 // Assert that all DefPathHashes correctly contain the local crate's StableCrateId.
4444 debug_assert_eq ! ( self . stable_crate_id, def_path_hash. stable_crate_id( ) ) ;
45+ let local_hash = def_path_hash. local_hash ( ) ;
4546
4647 let index = {
4748 let index = DefIndex :: from ( self . index_to_key . len ( ) ) ;
4849 debug ! ( "DefPathTable::insert() - {:?} <-> {:?}" , key, index) ;
4950 self . index_to_key . push ( key) ;
5051 index
5152 } ;
52- self . def_path_hashes . push ( def_path_hash . local_hash ( ) ) ;
53+ self . def_path_hashes . push ( local_hash) ;
5354 debug_assert ! ( self . def_path_hashes. len( ) == self . index_to_key. len( ) ) ;
5455
5556 // Check for hash collisions of DefPathHashes. These should be
5657 // exceedingly rare.
57- if let Some ( existing) = self . def_path_hash_to_index . insert ( & def_path_hash , & index) {
58+ if let Some ( existing) = self . def_path_hash_to_index . insert ( & local_hash , & index) {
5859 let def_path1 = DefPath :: make ( LOCAL_CRATE , existing, |idx| self . def_key ( idx) ) ;
5960 let def_path2 = DefPath :: make ( LOCAL_CRATE , index, |idx| self . def_key ( idx) ) ;
6061
@@ -382,7 +383,7 @@ impl Definitions {
382383 debug_assert ! ( hash. stable_crate_id( ) == self . table. stable_crate_id) ;
383384 self . table
384385 . def_path_hash_to_index
385- . get ( & hash)
386+ . get ( & hash. local_hash ( ) )
386387 . map ( |local_def_index| LocalDefId { local_def_index } )
387388 . unwrap_or_else ( || err ( ) )
388389 }
0 commit comments