about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-05-10 08:24:02 +0200
committerGitHub <noreply@github.com>2022-05-10 08:24:02 +0200
commitc5c273b30e2464de2c4de2cc4c9d2696de540e7f (patch)
treeb4b5f7d7e0e4673a1219041d057dc266fa1e0736
parentdd83ae2cd6f6846e5f1f949f28c0331f922abe3c (diff)
parent6096cfbfffdaebd5eca5e0816086e31f10de7eb8 (diff)
downloadrust-c5c273b30e2464de2c4de2cc4c9d2696de540e7f.tar.gz
rust-c5c273b30e2464de2c4de2cc4c9d2696de540e7f.zip
Rollup merge of #96674 - bstrie:vardoc, r=thomcc
docs: add link explaining variance to NonNull docs
-rw-r--r--library/core/src/ptr/non_null.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs
index 5ebe6150906..9946db67db9 100644
--- a/library/core/src/ptr/non_null.rs
+++ b/library/core/src/ptr/non_null.rs
@@ -9,7 +9,7 @@ use crate::ops::{CoerceUnsized, DispatchFromDyn};
 use crate::ptr::Unique;
 use crate::slice::{self, SliceIndex};
 
-/// `*mut T` but non-zero and covariant.
+/// `*mut T` but non-zero and [covariant].
 ///
 /// This is often the correct thing to use when building data structures using
 /// raw pointers, but is ultimately more dangerous to use because of its additional
@@ -42,6 +42,7 @@ use crate::slice::{self, SliceIndex};
 /// it is your responsibility to ensure that `as_mut` is never called, and `as_ptr`
 /// is never used for mutation.
 ///
+/// [covariant]: https://doc.rust-lang.org/reference/subtyping.html
 /// [`PhantomData`]: crate::marker::PhantomData
 /// [`UnsafeCell<T>`]: crate::cell::UnsafeCell
 #[stable(feature = "nonnull", since = "1.25.0")]