diff options
| author | Ralf Jung <post@ralfj.de> | 2022-06-05 11:44:12 -0400 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-06-05 11:50:48 -0400 |
| commit | 4a41c3574251ced43076acd28a9e63a5937802d5 (patch) | |
| tree | d13249d9c4b09ae43242d7fd4b5f87642140f371 | |
| parent | 4322a785cc99ea5fc81dd7f5fc8ba7f7a64b08ef (diff) | |
| download | rust-4a41c3574251ced43076acd28a9e63a5937802d5.tar.gz rust-4a41c3574251ced43076acd28a9e63a5937802d5.zip | |
use strict provenance APIs
| -rw-r--r-- | library/core/src/ptr/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index 5b04ae7b07e..a3b4e5886ef 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -532,7 +532,7 @@ pub const fn null<T>() -> *const T { #[rustc_diagnostic_item = "ptr_null"] #[cfg(not(bootstrap))] pub const fn null<T: ?Sized + Thin>() -> *const T { - from_raw_parts(0 as *const (), ()) + from_raw_parts(invalid(0), ()) } /// Creates a null mutable raw pointer. @@ -709,7 +709,7 @@ where #[rustc_diagnostic_item = "ptr_null_mut"] #[cfg(not(bootstrap))] pub const fn null_mut<T: ?Sized + Thin>() -> *mut T { - from_raw_parts_mut(0 as *mut (), ()) + from_raw_parts_mut(invalid_mut(0), ()) } /// Forms a raw slice from a pointer and a length. |
