Skip to content

Commit c5c273b

Browse files
authored
Rollup merge of rust-lang#96674 - bstrie:vardoc, r=thomcc
docs: add link explaining variance to NonNull docs
2 parents dd83ae2 + 6096cfb commit c5c273b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/ptr/non_null.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::ops::{CoerceUnsized, DispatchFromDyn};
99
use crate::ptr::Unique;
1010
use crate::slice::{self, SliceIndex};
1111

12-
/// `*mut T` but non-zero and covariant.
12+
/// `*mut T` but non-zero and [covariant].
1313
///
1414
/// This is often the correct thing to use when building data structures using
1515
/// raw pointers, but is ultimately more dangerous to use because of its additional
@@ -42,6 +42,7 @@ use crate::slice::{self, SliceIndex};
4242
/// it is your responsibility to ensure that `as_mut` is never called, and `as_ptr`
4343
/// is never used for mutation.
4444
///
45+
/// [covariant]: https://doc.rust-lang.org/reference/subtyping.html
4546
/// [`PhantomData`]: crate::marker::PhantomData
4647
/// [`UnsafeCell<T>`]: crate::cell::UnsafeCell
4748
#[stable(feature = "nonnull", since = "1.25.0")]

0 commit comments

Comments
 (0)