Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More intra doc links #77875

Merged
merged 11 commits into from
Dec 1, 2020
6 changes: 3 additions & 3 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand All @@ -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
///
Expand Down Expand Up @@ -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
///
Expand Down
43 changes: 19 additions & 24 deletions library/core/src/char/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`].
///
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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
///
Expand Down Expand Up @@ -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
///
Expand All @@ -504,7 +500,6 @@ impl char {
/// println!("{}", '"'.escape_default());
/// ```
///
///
/// Both are equivalent to:
///
/// ```
Expand Down Expand Up @@ -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
///
Expand Down Expand Up @@ -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
///
Expand All @@ -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 {
Expand All @@ -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
///
Expand All @@ -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 {
Expand Down Expand Up @@ -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
///
Expand All @@ -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) {
Expand All @@ -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
///
Expand All @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions library/core/src/iter/adapters/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>> {
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/iter/adapters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
10 changes: 5 additions & 5 deletions library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand Down
28 changes: 14 additions & 14 deletions library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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) {
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand All @@ -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
///
Expand Down