Make the stdlib largely conform to strict provenance.
Some things like the unwinders and system APIs are not fully conformant, this only covers a lot of low-hanging fruit.
This commit is contained in:
@@ -194,7 +194,7 @@ impl Layout {
|
||||
#[inline]
|
||||
pub const fn dangling(&self) -> NonNull<u8> {
|
||||
// SAFETY: align is guaranteed to be non-zero
|
||||
unsafe { NonNull::new_unchecked(self.align() as *mut u8) }
|
||||
unsafe { NonNull::new_unchecked(crate::ptr::invalid_mut::<u8>(self.align())) }
|
||||
}
|
||||
|
||||
/// Creates a layout describing the record that can hold a value
|
||||
|
||||
Reference in New Issue
Block a user