We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00f4d06 commit 6c72394Copy full SHA for 6c72394
1 file changed
library/alloc/src/raw_vec.rs
@@ -489,12 +489,12 @@ impl<A: Allocator> RawVecInner<A> {
489
490
#[inline]
491
const fn ptr<T>(&self) -> *mut T {
492
- self.ptr.as_ptr() as _
+ self.non_null::<T>().as_ptr()
493
}
494
495
496
- fn non_null<T>(&self) -> NonNull<T> {
497
- self.ptr.cast().into()
+ const fn non_null<T>(&self) -> NonNull<T> {
+ self.ptr.cast().as_non_null_ptr()
498
499
500
0 commit comments