diff options
Diffstat (limited to 'library/core/src/ptr')
| -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 5f3815859c8..8d7192c1b0f 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -812,7 +812,7 @@ pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T { #[rustc_allow_const_fn_unstable(ptr_metadata)] #[rustc_diagnostic_item = "ptr_slice_from_raw_parts"] pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] { - from_raw_parts(data.cast(), len) + intrinsics::aggregate_raw_ptr(data, len) } /// Forms a raw mutable slice from a pointer and a length. @@ -858,7 +858,7 @@ pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] { #[rustc_const_unstable(feature = "const_slice_from_raw_parts_mut", issue = "67456")] #[rustc_diagnostic_item = "ptr_slice_from_raw_parts_mut"] pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] { - from_raw_parts_mut(data.cast(), len) + intrinsics::aggregate_raw_ptr(data, len) } /// Swaps the values at two mutable locations of the same type, without |
