Skip to content

Commit f7fe213

Browse files
committed
make internal NonNull methods available to the alloc crate
1 parent e9f6fdd commit f7fe213

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

library/core/src/ptr/non_null.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ impl<T: ?Sized> NonNull<T> {
452452

453453
/// See [`pointer::add`] for semantics and safety requirements.
454454
#[inline]
455-
pub(crate) const unsafe fn add(self, delta: usize) -> Self
455+
#[doc(hidden)]
456+
#[unstable(feature = "std_internals", issue = "none")]
457+
pub const unsafe fn add(self, delta: usize) -> Self
456458
where
457459
T: Sized,
458460
{
@@ -465,7 +467,9 @@ impl<T: ?Sized> NonNull<T> {
465467

466468
/// See [`pointer::sub`] for semantics and safety requirements.
467469
#[inline]
468-
pub(crate) const unsafe fn sub(self, delta: usize) -> Self
470+
#[doc(hidden)]
471+
#[unstable(feature = "std_internals", issue = "none")]
472+
pub const unsafe fn sub(self, delta: usize) -> Self
469473
where
470474
T: Sized,
471475
{
@@ -478,7 +482,9 @@ impl<T: ?Sized> NonNull<T> {
478482

479483
/// See [`pointer::sub_ptr`] for semantics and safety requirements.
480484
#[inline]
481-
pub(crate) const unsafe fn sub_ptr(self, subtrahend: Self) -> usize
485+
#[doc(hidden)]
486+
#[unstable(feature = "std_internals", issue = "none")]
487+
pub const unsafe fn sub_ptr(self, subtrahend: Self) -> usize
482488
where
483489
T: Sized,
484490
{

0 commit comments

Comments
 (0)