diff --git a/src/raw/mod.rs b/src/raw/mod.rs index db5384641..44221f7c9 100644 --- a/src/raw/mod.rs +++ b/src/raw/mod.rs @@ -1235,7 +1235,7 @@ impl RawTable { fallibility, Self::TABLE_LAYOUT, if T::NEEDS_DROP { - Some(mem::transmute(ptr::drop_in_place:: as unsafe fn(*mut T))) + Some(|ptr| ptr::drop_in_place(ptr as *mut T)) } else { None }, @@ -2911,7 +2911,7 @@ impl RawTableInner { hasher: &dyn Fn(&mut Self, usize) -> u64, fallibility: Fallibility, layout: TableLayout, - drop: Option, + drop: Option, ) -> Result<(), TryReserveError> where A: Allocator, @@ -3145,7 +3145,7 @@ impl RawTableInner { &mut self, hasher: &dyn Fn(&mut Self, usize) -> u64, size_of: usize, - drop: Option, + drop: Option, ) { // If the hash function panics then properly clean up any elements // that we haven't rehashed yet. We unfortunately can't preserve the @@ -4577,7 +4577,7 @@ mod test_map { &|table, index| hasher(table.bucket::(index).as_ref()), mem::size_of::(), if mem::needs_drop::() { - Some(mem::transmute(ptr::drop_in_place:: as unsafe fn(*mut T))) + Some(|ptr| ptr::drop_in_place(ptr as *mut T)) } else { None },