Skip to content

Commit 2693d12

Browse files
committed
cast the entire slice to a raw pointer, not just the first element
1 parent 4368aa4 commit 2693d12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/raw/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ impl<T> RawTable<T> {
357357
pub fn new() -> Self {
358358
Self {
359359
data: NonNull::dangling(),
360-
ctrl: NonNull::from(&Group::static_empty()[0]),
360+
// Be careful to cast the entire slice to a raw pointer.
361+
ctrl: unsafe { NonNull::new_unchecked(Group::static_empty().as_ptr() as *mut u8) },
361362
bucket_mask: 0,
362363
items: 0,
363364
growth_left: 0,

0 commit comments

Comments
 (0)