From 6c72394b5e87b7c2e2a90b0e1da61f632bfdea42 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Sun, 6 Oct 2024 17:10:20 -0400 Subject: [PATCH] liballoc/RawVec: constify non_null, restore ptr impl --- library/alloc/src/raw_vec.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs index 59d24fff320c2..8fdca8c420036 100644 --- a/library/alloc/src/raw_vec.rs +++ b/library/alloc/src/raw_vec.rs @@ -489,12 +489,12 @@ impl RawVecInner { #[inline] const fn ptr(&self) -> *mut T { - self.ptr.as_ptr() as _ + self.non_null::().as_ptr() } #[inline] - fn non_null(&self) -> NonNull { - self.ptr.cast().into() + const fn non_null(&self) -> NonNull { + self.ptr.cast().as_non_null_ptr() } #[inline]