Auto merge of #77875 - poliorcetics:more-intra-doc-links, r=jyn514

More intra doc links

Helps with #75080.

I did a commit by group of file, I can squash if wanted.

`@rustbot` modify labels: T-doc, A-intra-doc-links

r? `@jyn514`
This commit is contained in:
bors 2020-12-01 02:45:26 +00:00
commit becec6d01e
7 changed files with 47 additions and 53 deletions

View File

@ -929,7 +929,7 @@ impl<T: ?Sized> RefCell<T> {
/// Also, please be aware that this method is only for special circumstances and is usually
/// not what you want. In case of doubt, use [`borrow_mut`] instead.
///
/// [`borrow_mut`]: #method.borrow_mut
/// [`borrow_mut`]: RefCell::borrow_mut()
///
/// # Examples
///
@ -953,7 +953,7 @@ impl<T: ?Sized> RefCell<T> {
/// ensure no borrows exist and then resets the state tracking shared borrows. This is relevant
/// if some `Ref` or `RefMut` borrows have been leaked.
///
/// [`get_mut`]: #method.get_mut
/// [`get_mut`]: RefCell::get_mut()
///
/// # Examples
///
@ -1745,7 +1745,7 @@ impl<T: ?Sized> UnsafeCell<T> {
/// when casting to `&mut T`, and ensure that there are no mutations
/// or mutable aliases going on when casting to `&T`.
///
/// [`get`]: #method.get
/// [`get`]: UnsafeCell::get()
///
/// # Examples
///

View File

@ -109,8 +109,6 @@ impl char {
/// `char`s. `from_u32()` will return `None` if the input is not a valid value
/// for a `char`.
///
/// [`u32`]: primitive.u32.html
///
/// For an unsafe version of this function which ignores these checks, see
/// [`from_u32_unchecked`].
///
@ -159,8 +157,6 @@ impl char {
/// `char`s. `from_u32_unchecked()` will ignore this, and blindly cast to
/// `char`, possibly creating an invalid one.
///
/// [`u32`]: primitive.u32.html
///
/// # Safety
///
/// This function is unsafe, as it may construct invalid `char` values.
@ -249,7 +245,7 @@ impl char {
/// sixteen, hexadecimal, to give some common values. Arbitrary
/// radices are supported.
///
/// Compared to `is_numeric()`, this function only recognizes the characters
/// Compared to [`is_numeric()`], this function only recognizes the characters
/// `0-9`, `a-z` and `A-Z`.
///
/// 'Digit' is defined to be only the following characters:
@ -258,9 +254,9 @@ impl char {
/// * `a-z`
/// * `A-Z`
///
/// For a more comprehensive understanding of 'digit', see [`is_numeric`][is_numeric].
/// For a more comprehensive understanding of 'digit', see [`is_numeric()`].
///
/// [is_numeric]: #method.is_numeric
/// [`is_numeric()`]: #method.is_numeric
///
/// # Panics
///
@ -483,9 +479,9 @@ impl char {
/// * Any character in the 'printable ASCII' range `0x20` .. `0x7e`
/// inclusive is not escaped.
/// * All other characters are given hexadecimal Unicode escapes; see
/// [`escape_unicode`][escape_unicode].
/// [`escape_unicode`].
///
/// [escape_unicode]: #method.escape_unicode
/// [`escape_unicode`]: #method.escape_unicode
///
/// # Examples
///
@ -504,7 +500,6 @@ impl char {
/// println!("{}", '"'.escape_default());
/// ```
///
///
/// Both are equivalent to:
///
/// ```
@ -584,10 +579,10 @@ impl char {
/// Returns the number of 16-bit code units this `char` would need if
/// encoded in UTF-16.
///
/// See the documentation for [`len_utf8`] for more explanation of this
/// See the documentation for [`len_utf8()`] for more explanation of this
/// concept. This function is a mirror, but for UTF-16 instead of UTF-8.
///
/// [`len_utf8`]: #method.len_utf8
/// [`len_utf8()`]: #method.len_utf8
///
/// # Examples
///
@ -1075,10 +1070,10 @@ impl char {
/// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
/// but non-ASCII letters are unchanged.
///
/// To uppercase the value in-place, use [`make_ascii_uppercase`].
/// To uppercase the value in-place, use [`make_ascii_uppercase()`].
///
/// To uppercase ASCII characters in addition to non-ASCII characters, use
/// [`to_uppercase`].
/// [`to_uppercase()`].
///
/// # Examples
///
@ -1090,8 +1085,8 @@ impl char {
/// assert_eq!('❤', non_ascii.to_ascii_uppercase());
/// ```
///
/// [`make_ascii_uppercase`]: #method.make_ascii_uppercase
/// [`to_uppercase`]: #method.to_uppercase
/// [`make_ascii_uppercase()`]: #method.make_ascii_uppercase
/// [`to_uppercase()`]: #method.to_uppercase
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline]
pub fn to_ascii_uppercase(&self) -> char {
@ -1103,10 +1098,10 @@ impl char {
/// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
/// but non-ASCII letters are unchanged.
///
/// To lowercase the value in-place, use [`make_ascii_lowercase`].
/// To lowercase the value in-place, use [`make_ascii_lowercase()`].
///
/// To lowercase ASCII characters in addition to non-ASCII characters, use
/// [`to_lowercase`].
/// [`to_lowercase()`].
///
/// # Examples
///
@ -1118,8 +1113,8 @@ impl char {
/// assert_eq!('❤', non_ascii.to_ascii_lowercase());
/// ```
///
/// [`make_ascii_lowercase`]: #method.make_ascii_lowercase
/// [`to_lowercase`]: #method.to_lowercase
/// [`make_ascii_lowercase()`]: #method.make_ascii_lowercase
/// [`to_lowercase()`]: #method.to_lowercase
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline]
pub fn to_ascii_lowercase(&self) -> char {
@ -1153,7 +1148,7 @@ impl char {
/// but non-ASCII letters are unchanged.
///
/// To return a new uppercased value without modifying the existing one, use
/// [`to_ascii_uppercase`].
/// [`to_ascii_uppercase()`].
///
/// # Examples
///
@ -1165,7 +1160,7 @@ impl char {
/// assert_eq!('A', ascii);
/// ```
///
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
/// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline]
pub fn make_ascii_uppercase(&mut self) {
@ -1178,7 +1173,7 @@ impl char {
/// but non-ASCII letters are unchanged.
///
/// To return a new lowercased value without modifying the existing one, use
/// [`to_ascii_lowercase`].
/// [`to_ascii_lowercase()`].
///
/// # Examples
///
@ -1190,7 +1185,7 @@ impl char {
/// assert_eq!('a', ascii);
/// ```
///
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
/// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline]
pub fn make_ascii_lowercase(&mut self) {

View File

@ -120,8 +120,7 @@ where
/// This `struct` is created by the [`flatten`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`flatten`]: Iterator::flatten
/// [`Iterator`]: trait.Iterator.html
/// [`flatten`]: Iterator::flatten()
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "iterator_flatten", since = "1.29.0")]
pub struct Flatten<I: Iterator<Item: IntoIterator>> {

View File

@ -110,7 +110,7 @@ pub unsafe trait SourceIter {
/// * whatever remains in the source after iteration has stopped
/// * the memory that has become unused by advancing a consuming iterator
///
/// [`next()`]: Iterator::next
/// [`next()`]: Iterator::next()
unsafe fn as_inner(&mut self) -> &mut Self::Source;
}

View File

@ -723,7 +723,7 @@ impl<T: ?Sized> *const T {
///
/// See [`ptr::read`] for safety concerns and examples.
///
/// [`ptr::read`]: ./ptr/fn.read.html
/// [`ptr::read`]: crate::ptr::read()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn read(self) -> T
@ -743,7 +743,7 @@ impl<T: ?Sized> *const T {
///
/// See [`ptr::read_volatile`] for safety concerns and examples.
///
/// [`ptr::read_volatile`]: ./ptr/fn.read_volatile.html
/// [`ptr::read_volatile`]: crate::ptr::read_volatile()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn read_volatile(self) -> T
@ -761,7 +761,7 @@ impl<T: ?Sized> *const T {
///
/// See [`ptr::read_unaligned`] for safety concerns and examples.
///
/// [`ptr::read_unaligned`]: ./ptr/fn.read_unaligned.html
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn read_unaligned(self) -> T
@ -779,7 +779,7 @@ impl<T: ?Sized> *const T {
///
/// See [`ptr::copy`] for safety concerns and examples.
///
/// [`ptr::copy`]: ./ptr/fn.copy.html
/// [`ptr::copy`]: crate::ptr::copy()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn copy_to(self, dest: *mut T, count: usize)
@ -797,7 +797,7 @@ impl<T: ?Sized> *const T {
///
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
///
/// [`ptr::copy_nonoverlapping`]: ./ptr/fn.copy_nonoverlapping.html
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize)

View File

@ -830,7 +830,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::read`] for safety concerns and examples.
///
/// [`ptr::read`]: ./ptr/fn.read.html
/// [`ptr::read`]: crate::ptr::read()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn read(self) -> T
@ -850,7 +850,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::read_volatile`] for safety concerns and examples.
///
/// [`ptr::read_volatile`]: ./ptr/fn.read_volatile.html
/// [`ptr::read_volatile`]: crate::ptr::read_volatile()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn read_volatile(self) -> T
@ -868,7 +868,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::read_unaligned`] for safety concerns and examples.
///
/// [`ptr::read_unaligned`]: ./ptr/fn.read_unaligned.html
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn read_unaligned(self) -> T
@ -886,7 +886,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::copy`] for safety concerns and examples.
///
/// [`ptr::copy`]: ./ptr/fn.copy.html
/// [`ptr::copy`]: crate::ptr::copy()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn copy_to(self, dest: *mut T, count: usize)
@ -904,7 +904,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
///
/// [`ptr::copy_nonoverlapping`]: ./ptr/fn.copy_nonoverlapping.html
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize)
@ -922,7 +922,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::copy`] for safety concerns and examples.
///
/// [`ptr::copy`]: ./ptr/fn.copy.html
/// [`ptr::copy`]: crate::ptr::copy()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn copy_from(self, src: *const T, count: usize)
@ -940,7 +940,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
///
/// [`ptr::copy_nonoverlapping`]: ./ptr/fn.copy_nonoverlapping.html
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn copy_from_nonoverlapping(self, src: *const T, count: usize)
@ -955,7 +955,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::drop_in_place`] for safety concerns and examples.
///
/// [`ptr::drop_in_place`]: ./ptr/fn.drop_in_place.html
/// [`ptr::drop_in_place`]: crate::ptr::drop_in_place()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn drop_in_place(self) {
@ -968,7 +968,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::write`] for safety concerns and examples.
///
/// [`ptr::write`]: ./ptr/fn.write.html
/// [`ptr::write`]: crate::ptr::write()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn write(self, val: T)
@ -984,7 +984,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::write_bytes`] for safety concerns and examples.
///
/// [`ptr::write_bytes`]: ./ptr/fn.write_bytes.html
/// [`ptr::write_bytes`]: crate::ptr::write_bytes()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn write_bytes(self, val: u8, count: usize)
@ -1004,7 +1004,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::write_volatile`] for safety concerns and examples.
///
/// [`ptr::write_volatile`]: ./ptr/fn.write_volatile.html
/// [`ptr::write_volatile`]: crate::ptr::write_volatile()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn write_volatile(self, val: T)
@ -1022,7 +1022,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::write_unaligned`] for safety concerns and examples.
///
/// [`ptr::write_unaligned`]: ./ptr/fn.write_unaligned.html
/// [`ptr::write_unaligned`]: crate::ptr::write_unaligned()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn write_unaligned(self, val: T)
@ -1038,7 +1038,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::replace`] for safety concerns and examples.
///
/// [`ptr::replace`]: ./ptr/fn.replace.html
/// [`ptr::replace`]: crate::ptr::replace()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn replace(self, src: T) -> T
@ -1055,7 +1055,7 @@ impl<T: ?Sized> *mut T {
///
/// See [`ptr::swap`] for safety concerns and examples.
///
/// [`ptr::swap`]: ./ptr/fn.swap.html
/// [`ptr::swap`]: crate::ptr::swap()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
pub unsafe fn swap(self, with: *mut T)

View File

@ -2252,9 +2252,9 @@ impl str {
/// but non-ASCII letters are unchanged.
///
/// To return a new uppercased value without modifying the existing one, use
/// [`to_ascii_uppercase`].
/// [`to_ascii_uppercase()`].
///
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
/// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase
///
/// # Examples
///
@ -2279,9 +2279,9 @@ impl str {
/// but non-ASCII letters are unchanged.
///
/// To return a new lowercased value without modifying the existing one, use
/// [`to_ascii_lowercase`].
/// [`to_ascii_lowercase()`].
///
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
/// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase
///
/// # Examples
///