strict provenance, lol

This commit is contained in:
nora 2022-09-15 19:35:10 +02:00
parent f033557c51
commit c71158bcf5
2 changed files with 2 additions and 2 deletions

View file

@ -1,5 +1,5 @@
#![cfg_attr(not(test), no_std)] #![cfg_attr(not(test), no_std)]
#![feature(ptr_metadata)] #![feature(ptr_metadata, strict_provenance)]
#![feature(unsize)] #![feature(unsize)]
#![deny(unsafe_op_in_unsafe_fn)] #![deny(unsafe_op_in_unsafe_fn)]

View file

@ -242,7 +242,7 @@ impl<T: ?Sized> RawVechonk<T> {
// SAFETY: The value has no size, so it's ok for it to be dangling around // SAFETY: The value has no size, so it's ok for it to be dangling around
return unsafe { return unsafe {
Box::from_raw(ptr::from_raw_parts_mut::<T>( Box::from_raw(ptr::from_raw_parts_mut::<T>(
mem::align_of_val(elem_fat_ref) as *mut (), ptr::invalid::<()>(mem::align_of_val(elem_fat_ref)) as *mut (),
data.meta, data.meta,
)) ))
}; };