Skip to content

Commit 68b639d

Browse files
capickettfacebook-github-bot
authored andcommitted
Migrate off of RawTable APIs
Summary: The `RawTable` APIs are removed in latest `hashbrown` upgrade (coming in D68793000). rust-lang/hashbrown#546 The PR notes that users should migrate to the `HashTable` APIs instead. - `HashTable`: https://docs.rs/hashbrown/latest/hashbrown/struct.HashTable.html - `RawTable`: https://docs.rs/hashbrown/0.14.5/hashbrown/raw/struct.RawTable.html Reviewed By: dtolnay Differential Revision: D69195912 fbshipit-source-id: b5c4d0cc33a977d9ceb247ffedcf49d7be0b01ec
1 parent 51d745c commit 68b639d

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

allocative/src/impls/hashbrown.rs

-34
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use std::mem;
1313

14-
use hashbrown::raw::RawTable;
1514
use hashbrown::HashTable;
1615

1716
use crate::Allocative;
@@ -20,28 +19,6 @@ use crate::Visitor;
2019

2120
const CAPACITY_NAME: Key = Key::new("capacity");
2221

23-
impl<T: Allocative> Allocative for RawTable<T> {
24-
fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
25-
use crate::impls::common::DATA_NAME;
26-
use crate::impls::hashbrown_util;
27-
28-
let mut visitor = visitor.enter_self_sized::<Self>();
29-
{
30-
let mut visitor = visitor.enter_unique(DATA_NAME, mem::size_of::<*const T>());
31-
{
32-
let mut visitor = visitor.enter(
33-
CAPACITY_NAME,
34-
hashbrown_util::raw_table_alloc_size_for_len::<T>(self.capacity()),
35-
);
36-
unsafe { visitor.visit_iter(self.iter().map(|e| e.as_ref())) };
37-
visitor.exit();
38-
}
39-
visitor.exit();
40-
}
41-
visitor.exit();
42-
}
43-
}
44-
4522
impl<T: Allocative> Allocative for HashTable<T> {
4623
fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
4724
use crate::impls::common::DATA_NAME;
@@ -70,7 +47,6 @@ mod tests {
7047
use std::hash::Hash;
7148
use std::hash::Hasher;
7249

73-
use hashbrown::raw::RawTable;
7450
use hashbrown::HashTable;
7551

7652
use crate::golden::golden_test;
@@ -81,16 +57,6 @@ mod tests {
8157
hasher.finish()
8258
}
8359

84-
#[test]
85-
fn test_raw_table() {
86-
let mut table = RawTable::with_capacity(100);
87-
for i in 0..100 {
88-
table.insert(hash(&i.to_string()), i.to_string(), hash);
89-
}
90-
91-
golden_test!(&table);
92-
}
93-
9460
#[test]
9561
fn test_hash_table() {
9662
let mut table = HashTable::with_capacity(100);

0 commit comments

Comments
 (0)