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:
Aria Beingessner
2022-03-22 01:24:55 -04:00
parent 5167b6891c
commit c7de289e1c
30 changed files with 100 additions and 81 deletions

View File

@@ -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