about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-04-05 01:53:34 +0200
committerGitHub <noreply@github.com>2022-04-05 01:53:34 +0200
commit1c2b4b7af51187159b8dfd5c7002cabfa01aeaf4 (patch)
treed095e82881f7a22bc5488f8451192b358626f251
parent78f81f0d10484f244b99361db359ba8a6a17e79b (diff)
parent637592d8c3d07aeb2a204402fe250c6a763aa452 (diff)
downloadrust-1c2b4b7af51187159b8dfd5c7002cabfa01aeaf4.tar.gz
rust-1c2b4b7af51187159b8dfd5c7002cabfa01aeaf4.zip
Rollup merge of #95630 - declanvk:update-nonnull-doc, r=RalfJung
Update `NonNull` pointer provenance methods' documentation

 - Add links to equivalent methods on raw pointers
-rw-r--r--library/core/src/ptr/non_null.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs
index 7516d4bba4c..6f402924e75 100644
--- a/library/core/src/ptr/non_null.rs
+++ b/library/core/src/ptr/non_null.rs
@@ -256,8 +256,10 @@ impl<T: ?Sized> NonNull<T> {
 
     /// Gets the "address" portion of the pointer.
     ///
+    /// For more details see the equivalent method on a raw pointer, [`pointer::addr`].
+    ///
     /// This API and its claimed semantics are part of the Strict Provenance experiment,
-    /// see the [module documentation][crate::ptr] for details.
+    /// see the [`ptr` module documentation][crate::ptr].
     #[must_use]
     #[inline]
     #[unstable(feature = "strict_provenance", issue = "95228")]
@@ -272,8 +274,10 @@ impl<T: ?Sized> NonNull<T> {
 
     /// Creates a new pointer with the given address.
     ///
+    /// For more details see the equivalent method on a raw pointer, [`pointer::with_addr`].
+    ///
     /// This API and its claimed semantics are part of the Strict Provenance experiment,
-    /// see the [module documentation][crate::ptr] for details.
+    /// see the [`ptr` module documentation][crate::ptr].
     #[must_use]
     #[inline]
     #[unstable(feature = "strict_provenance", issue = "95228")]
@@ -287,10 +291,10 @@ impl<T: ?Sized> NonNull<T> {
 
     /// Creates a new pointer by mapping `self`'s address to a new one.
     ///
-    /// This is a convenience for [`with_addr`][Self::with_addr], see that method for details.
+    /// For more details see the equivalent method on a raw pointer, [`pointer::map_addr`].
     ///
     /// This API and its claimed semantics are part of the Strict Provenance experiment,
-    /// see the [module documentation][crate::ptr] for details.
+    /// see the [`ptr` module documentation][crate::ptr].
     #[must_use]
     #[inline]
     #[unstable(feature = "strict_provenance", issue = "95228")]