diff options
| author | Aria Beingessner <a.beingessner@gmail.com> | 2022-03-22 01:24:55 -0400 |
|---|---|---|
| committer | Aria Beingessner <a.beingessner@gmail.com> | 2022-03-29 20:18:21 -0400 |
| commit | c7de289e1c8d24bd55aaa33813e509920a00c364 (patch) | |
| tree | b8dcd314558cc77fe1353c890c39c7026b7414b8 /library/core/src/alloc | |
| parent | 5167b6891ccf05aa7a2191675e6c3da95d84374a (diff) | |
| download | rust-c7de289e1c8d24bd55aaa33813e509920a00c364.tar.gz rust-c7de289e1c8d24bd55aaa33813e509920a00c364.zip | |
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.
Diffstat (limited to 'library/core/src/alloc')
| -rw-r--r-- | library/core/src/alloc/layout.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs index ea639268652..0639d6eed62 100644 --- a/library/core/src/alloc/layout.rs +++ b/library/core/src/alloc/layout.rs @@ -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 |
