about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-03-26 22:26:45 +0100
committerGitHub <noreply@github.com>2019-03-26 22:26:45 +0100
commit616ee876c1767a2b934c55e90fd571f7476a1f45 (patch)
tree6fd0c15a7f18950773ee177b2a6b60fea0dfb030 /src
parent07c83488d560e064e26844afeb551100d2ded832 (diff)
parentfd42918a41c0093ac8db6bcf757f906c6adeaffa (diff)
downloadrust-616ee876c1767a2b934c55e90fd571f7476a1f45.tar.gz
rust-616ee876c1767a2b934c55e90fd571f7476a1f45.zip
Rollup merge of #59427 - czipperz:non_null_doc_links, r=Mark-Simulacrum
Link to PhantomData in NonNull documentation
Diffstat (limited to 'src')
-rw-r--r--src/libcore/ptr.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs
index b139c82753d..1897caa5aa5 100644
--- a/src/libcore/ptr.rs
+++ b/src/libcore/ptr.rs
@@ -2869,10 +2869,10 @@ impl<'a, T: ?Sized> From<NonNull<T>> for Unique<T> {
 /// However the pointer may still dangle if it isn't dereferenced.
 ///
 /// Unlike `*mut T`, `NonNull<T>` is covariant over `T`. If this is incorrect
-/// for your use case, you should include some PhantomData in your type to
+/// for your use case, you should include some [`PhantomData`] in your type to
 /// provide invariance, such as `PhantomData<Cell<T>>` or `PhantomData<&'a mut T>`.
 /// Usually this won't be necessary; covariance is correct for most safe abstractions,
-/// such as Box, Rc, Arc, Vec, and LinkedList. This is the case because they
+/// such as `Box`, `Rc`, `Arc`, `Vec`, and `LinkedList`. This is the case because they
 /// provide a public API that follows the normal shared XOR mutable rules of Rust.
 ///
 /// Notice that `NonNull<T>` has a `From` instance for `&T`. However, this does
@@ -2883,6 +2883,7 @@ impl<'a, T: ?Sized> From<NonNull<T>> for Unique<T> {
 /// it is your responsibility to ensure that `as_mut` is never called, and `as_ptr`
 /// is never used for mutation.
 ///
+/// [`PhantomData`]: ../marker/struct.PhantomData.html
 /// [`UnsafeCell<T>`]: ../cell/struct.UnsafeCell.html
 #[stable(feature = "nonnull", since = "1.25.0")]
 #[repr(transparent)]