pub(crate) struct ConstNonNull<T: ?Sized> {
pointer: *const T,
}
impl<T: ?Sized> ConstNonNull<T> {
#[inline]
pub const unsafe fn new_unchecked(ptr: *const T) -> Self {
unsafe { ConstNonNull { pointer: ptr } }
}
#[must_use]
#[inline]
pub const fn as_ptr(self) -> *const T {
self.pointer
}
}
impl<T: ?Sized> Clone for ConstNonNull<T> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<T: ?Sized> Copy for ConstNonNull<T> {}