Skip to content

Commit 1c2b4b7

Browse files
authored
Rollup merge of #95630 - declanvk:update-nonnull-doc, r=RalfJung
Update `NonNull` pointer provenance methods' documentation - Add links to equivalent methods on raw pointers
2 parents 78f81f0 + 637592d commit 1c2b4b7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

library/core/src/ptr/non_null.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,10 @@ impl<T: ?Sized> NonNull<T> {
256256

257257
/// Gets the "address" portion of the pointer.
258258
///
259+
/// For more details see the equivalent method on a raw pointer, [`pointer::addr`].
260+
///
259261
/// This API and its claimed semantics are part of the Strict Provenance experiment,
260-
/// see the [module documentation][crate::ptr] for details.
262+
/// see the [`ptr` module documentation][crate::ptr].
261263
#[must_use]
262264
#[inline]
263265
#[unstable(feature = "strict_provenance", issue = "95228")]
@@ -272,8 +274,10 @@ impl<T: ?Sized> NonNull<T> {
272274

273275
/// Creates a new pointer with the given address.
274276
///
277+
/// For more details see the equivalent method on a raw pointer, [`pointer::with_addr`].
278+
///
275279
/// This API and its claimed semantics are part of the Strict Provenance experiment,
276-
/// see the [module documentation][crate::ptr] for details.
280+
/// see the [`ptr` module documentation][crate::ptr].
277281
#[must_use]
278282
#[inline]
279283
#[unstable(feature = "strict_provenance", issue = "95228")]
@@ -287,10 +291,10 @@ impl<T: ?Sized> NonNull<T> {
287291

288292
/// Creates a new pointer by mapping `self`'s address to a new one.
289293
///
290-
/// This is a convenience for [`with_addr`][Self::with_addr], see that method for details.
294+
/// For more details see the equivalent method on a raw pointer, [`pointer::map_addr`].
291295
///
292296
/// This API and its claimed semantics are part of the Strict Provenance experiment,
293-
/// see the [module documentation][crate::ptr] for details.
297+
/// see the [`ptr` module documentation][crate::ptr].
294298
#[must_use]
295299
#[inline]
296300
#[unstable(feature = "strict_provenance", issue = "95228")]

0 commit comments

Comments
 (0)