@@ -132,7 +132,7 @@ pub struct AstIdMap {
132132 /// Maps stable id to unstable ptr.
133133 arena : Arena < SyntaxNodePtr > ,
134134 /// Reverse: map ptr to id.
135- map : hashbrown:: HashMap < Idx < SyntaxNodePtr > , ( ) , ( ) > ,
135+ map : hashbrown:: HashTable < Idx < SyntaxNodePtr > > ,
136136}
137137
138138impl fmt:: Debug for AstIdMap {
@@ -169,13 +169,13 @@ impl AstIdMap {
169169 TreeOrder :: DepthFirst
170170 }
171171 } ) ;
172- res. map = hashbrown:: HashMap :: with_capacity_and_hasher ( res. arena . len ( ) , ( ) ) ;
172+ res. map = hashbrown:: HashTable :: with_capacity ( res. arena . len ( ) ) ;
173173 for ( idx, ptr) in res. arena . iter ( ) {
174174 let hash = hash_ptr ( ptr) ;
175- match res. map . raw_entry_mut ( ) . from_hash ( hash, |idx2| * idx2 == idx) {
176- hashbrown:: hash_map :: RawEntryMut :: Occupied ( _) => unreachable ! ( ) ,
177- hashbrown:: hash_map :: RawEntryMut :: Vacant ( entry) => {
178- entry. insert_with_hasher ( hash , idx, ( ) , | & idx| hash_ptr ( & res . arena [ idx ] ) ) ;
175+ match res. map . entry ( hash, |& idx2| idx2 == idx, | & idx| hash_ptr ( & res . arena [ idx ] ) ) {
176+ hashbrown:: hash_table :: Entry :: Occupied ( _) => unreachable ! ( ) ,
177+ hashbrown:: hash_table :: Entry :: Vacant ( entry) => {
178+ entry. insert ( idx) ;
179179 }
180180 }
181181 }
@@ -196,8 +196,8 @@ impl AstIdMap {
196196 pub fn ast_id_for_ptr < N : AstIdNode > ( & self , ptr : AstPtr < N > ) -> FileAstId < N > {
197197 let ptr = ptr. syntax_node_ptr ( ) ;
198198 let hash = hash_ptr ( & ptr) ;
199- match self . map . raw_entry ( ) . from_hash ( hash, |& idx| self . arena [ idx] == ptr) {
200- Some ( ( & raw, & ( ) ) ) => FileAstId {
199+ match self . map . find ( hash, |& idx| self . arena [ idx] == ptr) {
200+ Some ( & raw) => FileAstId {
201201 raw : ErasedFileAstId ( raw. into_raw ( ) . into_u32 ( ) ) ,
202202 covariant : PhantomData ,
203203 } ,
@@ -221,8 +221,8 @@ impl AstIdMap {
221221 fn erased_ast_id ( & self , item : & SyntaxNode ) -> ErasedFileAstId {
222222 let ptr = SyntaxNodePtr :: new ( item) ;
223223 let hash = hash_ptr ( & ptr) ;
224- match self . map . raw_entry ( ) . from_hash ( hash, |& idx| self . arena [ idx] == ptr) {
225- Some ( ( & idx, & ( ) ) ) => ErasedFileAstId ( idx. into_raw ( ) . into_u32 ( ) ) ,
224+ match self . map . find ( hash, |& idx| self . arena [ idx] == ptr) {
225+ Some ( & idx) => ErasedFileAstId ( idx. into_raw ( ) . into_u32 ( ) ) ,
226226 None => panic ! (
227227 "Can't find {:?} in AstIdMap:\n {:?}\n source text: {}" ,
228228 item,
0 commit comments