From 19fb4fec508d31489d05373ece476cdb182d12ce Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 13 Oct 2020 00:18:28 +0200 Subject: [PATCH 01/11] Intra doc links for cell.rs --- library/core/src/cell.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index e1b6307613b73..c7a76d33a6666 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -929,7 +929,7 @@ impl RefCell { /// 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 RefCell { /// 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 UnsafeCell { /// 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 /// From 0bf4aafc544845c8c888c5aac745d92282ece45f Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 13 Oct 2020 00:18:41 +0200 Subject: [PATCH 02/11] Intra doc links for the char primitive --- library/core/src/char/methods.rs | 51 ++++++++++++++------------------ 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs index 1b847addcf806..3fb5f30d2e415 100644 --- a/library/core/src/char/methods.rs +++ b/library/core/src/char/methods.rs @@ -109,12 +109,10 @@ 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`]. /// - /// [`from_u32_unchecked`]: #method.from_u32_unchecked + /// [`from_u32_unchecked`]: prim@char::from_u32_unchecked() /// /// # Examples /// @@ -159,15 +157,13 @@ 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. /// /// For a safe version of this function, see the [`from_u32`] function. /// - /// [`from_u32`]: #method.from_u32 + /// [`from_u32`]: prim@char::from_u32() /// /// # Examples /// @@ -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()`]: prim@char::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`]: prim@char::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()`]: prim@char::len_utf8() /// /// # Examples /// @@ -802,8 +797,8 @@ impl char { /// Returns `true` if this `char` satisfies either [`is_alphabetic()`] or [`is_numeric()`]. /// - /// [`is_alphabetic()`]: #method.is_alphabetic - /// [`is_numeric()`]: #method.is_numeric + /// [`is_alphabetic()`]: prim@char::is_alphabetic() + /// [`is_numeric()`]: prim@char::is_numeric() /// /// # 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()`]: prim@char::make_ascii_uppercase() + /// [`to_uppercase()`]: prim@char::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()`]: prim@char::make_ascii_lowercase() + /// [`to_lowercase()`]: prim@char::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()`]: prim@char::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()`]: prim@char::to_ascii_lowercase() #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn make_ascii_lowercase(&mut self) { From 9c27ccff1962a6a25992708f0d2d1f36a0ea4fa1 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 13 Oct 2020 00:24:09 +0200 Subject: [PATCH 03/11] Intra doc links for str/mod.rs --- library/core/src/str/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 604e317110c3e..c5a2a70c4f9d5 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -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()`]: prim@str::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()`]: prim@str::to_ascii_lowercase() /// /// # Examples /// From 4e54b4c3e67aa1b9aebb36e43ff00343155954d8 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 13 Oct 2020 00:40:40 +0200 Subject: [PATCH 04/11] Intra doc links for the pointer primitive --- library/core/src/ptr/const_ptr.rs | 10 +++++----- library/core/src/ptr/mut_ptr.rs | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index d09cdb44e0837..abffde316bbaf 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -723,7 +723,7 @@ impl *const T { /// /// See [`ptr::read`] for safety concerns and examples. /// - /// [`ptr::read`]: ./ptr/fn.read.html + /// [`ptr::read`]: read() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn read(self) -> T @@ -743,7 +743,7 @@ impl *const T { /// /// See [`ptr::read_volatile`] for safety concerns and examples. /// - /// [`ptr::read_volatile`]: ./ptr/fn.read_volatile.html + /// [`ptr::read_volatile`]: read_volatile() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn read_volatile(self) -> T @@ -761,7 +761,7 @@ impl *const T { /// /// See [`ptr::read_unaligned`] for safety concerns and examples. /// - /// [`ptr::read_unaligned`]: ./ptr/fn.read_unaligned.html + /// [`ptr::read_unaligned`]: read_unaligned() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn read_unaligned(self) -> T @@ -779,7 +779,7 @@ impl *const T { /// /// See [`ptr::copy`] for safety concerns and examples. /// - /// [`ptr::copy`]: ./ptr/fn.copy.html + /// [`ptr::copy`]: 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 *const T { /// /// See [`ptr::copy_nonoverlapping`] for safety concerns and examples. /// - /// [`ptr::copy_nonoverlapping`]: ./ptr/fn.copy_nonoverlapping.html + /// [`ptr::copy_nonoverlapping`]: copy_nonoverlapping() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize) diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs index 537aa20bf1dbc..1b342ce1f9152 100644 --- a/library/core/src/ptr/mut_ptr.rs +++ b/library/core/src/ptr/mut_ptr.rs @@ -830,7 +830,7 @@ impl *mut T { /// /// See [`ptr::read`] for safety concerns and examples. /// - /// [`ptr::read`]: ./ptr/fn.read.html + /// [`ptr::read`]: read() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn read(self) -> T @@ -850,7 +850,7 @@ impl *mut T { /// /// See [`ptr::read_volatile`] for safety concerns and examples. /// - /// [`ptr::read_volatile`]: ./ptr/fn.read_volatile.html + /// [`ptr::read_volatile`]: read_volatile() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn read_volatile(self) -> T @@ -868,7 +868,7 @@ impl *mut T { /// /// See [`ptr::read_unaligned`] for safety concerns and examples. /// - /// [`ptr::read_unaligned`]: ./ptr/fn.read_unaligned.html + /// [`ptr::read_unaligned`]: read_unaligned() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn read_unaligned(self) -> T @@ -886,7 +886,7 @@ impl *mut T { /// /// See [`ptr::copy`] for safety concerns and examples. /// - /// [`ptr::copy`]: ./ptr/fn.copy.html + /// [`ptr::copy`]: 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 *mut T { /// /// See [`ptr::copy_nonoverlapping`] for safety concerns and examples. /// - /// [`ptr::copy_nonoverlapping`]: ./ptr/fn.copy_nonoverlapping.html + /// [`ptr::copy_nonoverlapping`]: 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 *mut T { /// /// See [`ptr::copy`] for safety concerns and examples. /// - /// [`ptr::copy`]: ./ptr/fn.copy.html + /// [`ptr::copy`]: 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 *mut T { /// /// See [`ptr::copy_nonoverlapping`] for safety concerns and examples. /// - /// [`ptr::copy_nonoverlapping`]: ./ptr/fn.copy_nonoverlapping.html + /// [`ptr::copy_nonoverlapping`]: 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 *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`]: drop_in_place() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn drop_in_place(self) { @@ -968,7 +968,7 @@ impl *mut T { /// /// See [`ptr::write`] for safety concerns and examples. /// - /// [`ptr::write`]: ./ptr/fn.write.html + /// [`ptr::write`]: write() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn write(self, val: T) @@ -984,7 +984,7 @@ impl *mut T { /// /// See [`ptr::write_bytes`] for safety concerns and examples. /// - /// [`ptr::write_bytes`]: ./ptr/fn.write_bytes.html + /// [`ptr::write_bytes`]: 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 *mut T { /// /// See [`ptr::write_volatile`] for safety concerns and examples. /// - /// [`ptr::write_volatile`]: ./ptr/fn.write_volatile.html + /// [`ptr::write_volatile`]: write_volatile() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn write_volatile(self, val: T) @@ -1022,7 +1022,7 @@ impl *mut T { /// /// See [`ptr::write_unaligned`] for safety concerns and examples. /// - /// [`ptr::write_unaligned`]: ./ptr/fn.write_unaligned.html + /// [`ptr::write_unaligned`]: write_unaligned() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn write_unaligned(self, val: T) @@ -1038,7 +1038,7 @@ impl *mut T { /// /// See [`ptr::replace`] for safety concerns and examples. /// - /// [`ptr::replace`]: ./ptr/fn.replace.html + /// [`ptr::replace`]: replace() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn replace(self, src: T) -> T @@ -1055,7 +1055,7 @@ impl *mut T { /// /// See [`ptr::swap`] for safety concerns and examples. /// - /// [`ptr::swap`]: ./ptr/fn.swap.html + /// [`ptr::swap`]: swap() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn swap(self, with: *mut T) From b3b1e0c224eb0ec025a903f58b219513ff5d8807 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 13 Oct 2020 00:52:01 +0200 Subject: [PATCH 05/11] Intra doc links for f32/f64 --- library/core/src/num/f32.rs | 10 +++++----- library/core/src/num/f64.rs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs index 33df175bfc54d..5f335b73e9bd6 100644 --- a/library/core/src/num/f32.rs +++ b/library/core/src/num/f32.rs @@ -776,8 +776,8 @@ impl f32 { /// As the target platform's native endianness is used, portable code /// should use [`to_be_bytes`] or [`to_le_bytes`], as appropriate, instead. /// - /// [`to_be_bytes`]: #method.to_be_bytes - /// [`to_le_bytes`]: #method.to_le_bytes + /// [`to_be_bytes`]: prim@f32::to_be_bytes() + /// [`to_le_bytes`]: prim@f32::to_le_bytes() /// /// # Examples /// @@ -804,7 +804,7 @@ impl f32 { /// /// [`to_ne_bytes`] should be preferred over this whenever possible. /// - /// [`to_ne_bytes`]: #method.to_ne_bytes + /// [`to_ne_bytes`]: prim@f32::to_ne_bytes() /// /// # Examples /// @@ -864,8 +864,8 @@ impl f32 { /// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as /// appropriate instead. /// - /// [`from_be_bytes`]: #method.from_be_bytes - /// [`from_le_bytes`]: #method.from_le_bytes + /// [`from_be_bytes`]: prim@f32::from_be_bytes() + /// [`from_le_bytes`]: prim@f32::from_le_bytes() /// /// # Examples /// diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs index b85e8deb6d22c..271671d14ef25 100644 --- a/library/core/src/num/f64.rs +++ b/library/core/src/num/f64.rs @@ -790,8 +790,8 @@ impl f64 { /// As the target platform's native endianness is used, portable code /// should use [`to_be_bytes`] or [`to_le_bytes`], as appropriate, instead. /// - /// [`to_be_bytes`]: #method.to_be_bytes - /// [`to_le_bytes`]: #method.to_le_bytes + /// [`to_be_bytes`]: prim@f64::to_be_bytes() + /// [`to_le_bytes`]: prim@f64::to_le_bytes() /// /// # Examples /// @@ -818,7 +818,7 @@ impl f64 { /// /// [`to_ne_bytes`] should be preferred over this whenever possible. /// - /// [`to_ne_bytes`]: #method.to_ne_bytes + /// [`to_ne_bytes`]: prim@f64::to_ne_bytes() /// /// # Examples /// @@ -878,8 +878,8 @@ impl f64 { /// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as /// appropriate instead. /// - /// [`from_be_bytes`]: #method.from_be_bytes - /// [`from_le_bytes`]: #method.from_le_bytes + /// [`from_be_bytes`]: prim@f64::from_be_bytes() + /// [`from_le_bytes`]: prim@f64::from_le_bytes() /// /// # Examples /// From b702060865d7a21b4ada16434b8e80e1c203f409 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 13 Oct 2020 00:52:13 +0200 Subject: [PATCH 06/11] Intra doc links for iterator adapters --- Cargo.lock | 2 +- library/core/src/iter/adapters/flatten.rs | 3 +-- library/core/src/iter/adapters/mod.rs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18dfe890a0c1e..ae3a16b52b6ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5256,7 +5256,7 @@ dependencies = [ "chrono", "lazy_static", "matchers", - "parking_lot 0.11.0", + "parking_lot 0.9.0", "regex", "serde", "serde_json", diff --git a/library/core/src/iter/adapters/flatten.rs b/library/core/src/iter/adapters/flatten.rs index ff85e114dc982..29e191db0f62f 100644 --- a/library/core/src/iter/adapters/flatten.rs +++ b/library/core/src/iter/adapters/flatten.rs @@ -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> { diff --git a/library/core/src/iter/adapters/mod.rs b/library/core/src/iter/adapters/mod.rs index 5ef5717085e4f..b8d3430f91099 100644 --- a/library/core/src/iter/adapters/mod.rs +++ b/library/core/src/iter/adapters/mod.rs @@ -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; } From a5726eb28d3cf321b2accb772dec4f12103a8641 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 13 Oct 2020 08:49:16 +0200 Subject: [PATCH 07/11] Use Self:: in links --- library/core/src/cell.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index c7a76d33a6666..14cd8576e2ae1 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -929,7 +929,7 @@ impl RefCell { /// 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`]: RefCell::borrow_mut() + /// [`borrow_mut`]: Self::borrow_mut() /// /// # Examples /// @@ -953,7 +953,7 @@ impl RefCell { /// 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`]: RefCell::get_mut() + /// [`get_mut`]: Self::get_mut() /// /// # Examples /// @@ -1745,7 +1745,7 @@ impl UnsafeCell { /// when casting to `&mut T`, and ensure that there are no mutations /// or mutable aliases going on when casting to `&T`. /// - /// [`get`]: UnsafeCell::get() + /// [`get`]: Self::get() /// /// # Examples /// From ac8d1173b54d36d88c1ce1623ca52ecdf40d19a4 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 13 Oct 2020 08:52:48 +0200 Subject: [PATCH 08/11] Use core::primitive module instead of prim@ --- library/core/src/char/methods.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs index 3fb5f30d2e415..2df4f60cfaba2 100644 --- a/library/core/src/char/methods.rs +++ b/library/core/src/char/methods.rs @@ -112,7 +112,7 @@ impl char { /// For an unsafe version of this function which ignores these checks, see /// [`from_u32_unchecked`]. /// - /// [`from_u32_unchecked`]: prim@char::from_u32_unchecked() + /// [`from_u32_unchecked`]: crate::primitive::char::from_u32_unchecked() /// /// # Examples /// @@ -163,7 +163,7 @@ impl char { /// /// For a safe version of this function, see the [`from_u32`] function. /// - /// [`from_u32`]: prim@char::from_u32() + /// [`from_u32`]: crate::primitive::char::from_u32() /// /// # Examples /// @@ -256,7 +256,7 @@ impl char { /// /// For a more comprehensive understanding of 'digit', see [`is_numeric()`]. /// - /// [`is_numeric()`]: prim@char::is_numeric() + /// [`is_numeric()`]: crate::primitive::char::is_numeric() /// /// # Panics /// @@ -481,7 +481,7 @@ impl char { /// * All other characters are given hexadecimal Unicode escapes; see /// [`escape_unicode`]. /// - /// [`escape_unicode`]: prim@char::escape_unicode() + /// [`escape_unicode`]: crate::primitive::char::escape_unicode() /// /// # Examples /// @@ -582,7 +582,7 @@ impl char { /// 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()`]: prim@char::len_utf8() + /// [`len_utf8()`]: crate::primitive::char::len_utf8() /// /// # Examples /// @@ -797,8 +797,8 @@ impl char { /// Returns `true` if this `char` satisfies either [`is_alphabetic()`] or [`is_numeric()`]. /// - /// [`is_alphabetic()`]: prim@char::is_alphabetic() - /// [`is_numeric()`]: prim@char::is_numeric() + /// [`is_alphabetic()`]: crate::primitive::char::is_alphabetic() + /// [`is_numeric()`]: crate::primitive::char::is_numeric() /// /// # Examples /// @@ -1085,8 +1085,8 @@ impl char { /// assert_eq!('❤', non_ascii.to_ascii_uppercase()); /// ``` /// - /// [`make_ascii_uppercase()`]: prim@char::make_ascii_uppercase() - /// [`to_uppercase()`]: prim@char::to_uppercase() + /// [`make_ascii_uppercase()`]: crate::primitive::char::make_ascii_uppercase() + /// [`to_uppercase()`]: crate::primitive::char::to_uppercase() #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn to_ascii_uppercase(&self) -> char { @@ -1113,8 +1113,8 @@ impl char { /// assert_eq!('❤', non_ascii.to_ascii_lowercase()); /// ``` /// - /// [`make_ascii_lowercase()`]: prim@char::make_ascii_lowercase() - /// [`to_lowercase()`]: prim@char::to_lowercase() + /// [`make_ascii_lowercase()`]: crate::primitive::char::make_ascii_lowercase() + /// [`to_lowercase()`]: crate::primitive::char::to_lowercase() #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn to_ascii_lowercase(&self) -> char { @@ -1160,7 +1160,7 @@ impl char { /// assert_eq!('A', ascii); /// ``` /// - /// [`to_ascii_uppercase()`]: prim@char::to_ascii_uppercase() + /// [`to_ascii_uppercase()`]: crate::primitive::char::to_ascii_uppercase() #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn make_ascii_uppercase(&mut self) { @@ -1185,7 +1185,7 @@ impl char { /// assert_eq!('a', ascii); /// ``` /// - /// [`to_ascii_lowercase()`]: prim@char::to_ascii_lowercase() + /// [`to_ascii_lowercase()`]: crate::primitive::char::to_ascii_lowercase() #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[inline] pub fn make_ascii_lowercase(&mut self) { From af40c0430181c57a0fce8e74fea1e128889d7cb3 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 13 Oct 2020 08:59:45 +0200 Subject: [PATCH 09/11] ptr links --- library/core/src/ptr/const_ptr.rs | 10 +++++----- library/core/src/ptr/mut_ptr.rs | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index abffde316bbaf..8fd9ff768c4f4 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -723,7 +723,7 @@ impl *const T { /// /// See [`ptr::read`] for safety concerns and examples. /// - /// [`ptr::read`]: read() + /// [`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 *const T { /// /// See [`ptr::read_volatile`] for safety concerns and examples. /// - /// [`ptr::read_volatile`]: read_volatile() + /// [`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 *const T { /// /// See [`ptr::read_unaligned`] for safety concerns and examples. /// - /// [`ptr::read_unaligned`]: read_unaligned() + /// [`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 *const T { /// /// See [`ptr::copy`] for safety concerns and examples. /// - /// [`ptr::copy`]: copy() + /// [`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 *const T { /// /// See [`ptr::copy_nonoverlapping`] for safety concerns and examples. /// - /// [`ptr::copy_nonoverlapping`]: copy_nonoverlapping() + /// [`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) diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs index 1b342ce1f9152..5f94c2393aef3 100644 --- a/library/core/src/ptr/mut_ptr.rs +++ b/library/core/src/ptr/mut_ptr.rs @@ -830,7 +830,7 @@ impl *mut T { /// /// See [`ptr::read`] for safety concerns and examples. /// - /// [`ptr::read`]: read() + /// [`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 *mut T { /// /// See [`ptr::read_volatile`] for safety concerns and examples. /// - /// [`ptr::read_volatile`]: read_volatile() + /// [`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 *mut T { /// /// See [`ptr::read_unaligned`] for safety concerns and examples. /// - /// [`ptr::read_unaligned`]: read_unaligned() + /// [`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 *mut T { /// /// See [`ptr::copy`] for safety concerns and examples. /// - /// [`ptr::copy`]: copy() + /// [`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 *mut T { /// /// See [`ptr::copy_nonoverlapping`] for safety concerns and examples. /// - /// [`ptr::copy_nonoverlapping`]: copy_nonoverlapping() + /// [`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 *mut T { /// /// See [`ptr::copy`] for safety concerns and examples. /// - /// [`ptr::copy`]: copy() + /// [`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 *mut T { /// /// See [`ptr::copy_nonoverlapping`] for safety concerns and examples. /// - /// [`ptr::copy_nonoverlapping`]: copy_nonoverlapping() + /// [`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 *mut T { /// /// See [`ptr::drop_in_place`] for safety concerns and examples. /// - /// [`ptr::drop_in_place`]: drop_in_place() + /// [`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 *mut T { /// /// See [`ptr::write`] for safety concerns and examples. /// - /// [`ptr::write`]: write() + /// [`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 *mut T { /// /// See [`ptr::write_bytes`] for safety concerns and examples. /// - /// [`ptr::write_bytes`]: write_bytes() + /// [`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 *mut T { /// /// See [`ptr::write_volatile`] for safety concerns and examples. /// - /// [`ptr::write_volatile`]: write_volatile() + /// [`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 *mut T { /// /// See [`ptr::write_unaligned`] for safety concerns and examples. /// - /// [`ptr::write_unaligned`]: write_unaligned() + /// [`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 *mut T { /// /// See [`ptr::replace`] for safety concerns and examples. /// - /// [`ptr::replace`]: replace() + /// [`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 *mut T { /// /// See [`ptr::swap`] for safety concerns and examples. /// - /// [`ptr::swap`]: swap() + /// [`ptr::swap`]: crate::ptr::swap() #[stable(feature = "pointer_methods", since = "1.26.0")] #[inline] pub unsafe fn swap(self, with: *mut T) From c0560c275587db1131414dd395092ea5b80070b6 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Thu, 19 Nov 2020 14:55:57 +0100 Subject: [PATCH 10/11] Back to #method for links on char --- library/core/src/char/methods.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs index 2df4f60cfaba2..2baea7842a796 100644 --- a/library/core/src/char/methods.rs +++ b/library/core/src/char/methods.rs @@ -112,7 +112,7 @@ impl char { /// For an unsafe version of this function which ignores these checks, see /// [`from_u32_unchecked`]. /// - /// [`from_u32_unchecked`]: crate::primitive::char::from_u32_unchecked() + /// [`from_u32_unchecked`]: #method.from_u32_unchecked /// /// # Examples /// @@ -163,7 +163,7 @@ impl char { /// /// For a safe version of this function, see the [`from_u32`] function. /// - /// [`from_u32`]: crate::primitive::char::from_u32() + /// [`from_u32`]: #method.from_u32 /// /// # Examples /// @@ -256,7 +256,7 @@ impl char { /// /// For a more comprehensive understanding of 'digit', see [`is_numeric()`]. /// - /// [`is_numeric()`]: crate::primitive::char::is_numeric() + /// [`is_numeric()`]: #method.is_numeric /// /// # Panics /// @@ -481,7 +481,7 @@ impl char { /// * All other characters are given hexadecimal Unicode escapes; see /// [`escape_unicode`]. /// - /// [`escape_unicode`]: crate::primitive::char::escape_unicode() + /// [`escape_unicode`]: #method.escape_unicode /// /// # Examples /// @@ -582,7 +582,7 @@ impl char { /// 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()`]: crate::primitive::char::len_utf8() + /// [`len_utf8()`]: #method.len_utf8 /// /// # Examples /// @@ -797,8 +797,8 @@ impl char { /// Returns `true` if this `char` satisfies either [`is_alphabetic()`] or [`is_numeric()`]. /// - /// [`is_alphabetic()`]: crate::primitive::char::is_alphabetic() - /// [`is_numeric()`]: crate::primitive::char::is_numeric() + /// [`is_alphabetic()`]: #method.is_alphabetic + /// [`is_numeric()`]: #method.is_numeric /// /// # Examples /// @@ -1085,8 +1085,8 @@ impl char { /// assert_eq!('❤', non_ascii.to_ascii_uppercase()); /// ``` /// - /// [`make_ascii_uppercase()`]: crate::primitive::char::make_ascii_uppercase() - /// [`to_uppercase()`]: crate::primitive::char::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 { @@ -1113,8 +1113,8 @@ impl char { /// assert_eq!('❤', non_ascii.to_ascii_lowercase()); /// ``` /// - /// [`make_ascii_lowercase()`]: crate::primitive::char::make_ascii_lowercase() - /// [`to_lowercase()`]: crate::primitive::char::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 { @@ -1160,7 +1160,7 @@ impl char { /// assert_eq!('A', ascii); /// ``` /// - /// [`to_ascii_uppercase()`]: crate::primitive::char::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) { @@ -1185,7 +1185,7 @@ impl char { /// assert_eq!('a', ascii); /// ``` /// - /// [`to_ascii_lowercase()`]: crate::primitive::char::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) { From 5bdd6409139193ad73d991cba0ee8354457fa99a Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Mon, 30 Nov 2020 21:21:15 +0100 Subject: [PATCH 11/11] Fix several broken links in doc that used the wrong qualifier or Self:: --- Cargo.lock | 2 +- library/core/src/cell.rs | 6 +++--- library/core/src/num/f32.rs | 10 +++++----- library/core/src/num/f64.rs | 10 +++++----- library/core/src/str/mod.rs | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ae3a16b52b6ea..18dfe890a0c1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5256,7 +5256,7 @@ dependencies = [ "chrono", "lazy_static", "matchers", - "parking_lot 0.9.0", + "parking_lot 0.11.0", "regex", "serde", "serde_json", diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index 14cd8576e2ae1..c7a76d33a6666 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -929,7 +929,7 @@ impl RefCell { /// 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`]: Self::borrow_mut() + /// [`borrow_mut`]: RefCell::borrow_mut() /// /// # Examples /// @@ -953,7 +953,7 @@ impl RefCell { /// 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`]: Self::get_mut() + /// [`get_mut`]: RefCell::get_mut() /// /// # Examples /// @@ -1745,7 +1745,7 @@ impl UnsafeCell { /// when casting to `&mut T`, and ensure that there are no mutations /// or mutable aliases going on when casting to `&T`. /// - /// [`get`]: Self::get() + /// [`get`]: UnsafeCell::get() /// /// # Examples /// diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs index 5f335b73e9bd6..33df175bfc54d 100644 --- a/library/core/src/num/f32.rs +++ b/library/core/src/num/f32.rs @@ -776,8 +776,8 @@ impl f32 { /// As the target platform's native endianness is used, portable code /// should use [`to_be_bytes`] or [`to_le_bytes`], as appropriate, instead. /// - /// [`to_be_bytes`]: prim@f32::to_be_bytes() - /// [`to_le_bytes`]: prim@f32::to_le_bytes() + /// [`to_be_bytes`]: #method.to_be_bytes + /// [`to_le_bytes`]: #method.to_le_bytes /// /// # Examples /// @@ -804,7 +804,7 @@ impl f32 { /// /// [`to_ne_bytes`] should be preferred over this whenever possible. /// - /// [`to_ne_bytes`]: prim@f32::to_ne_bytes() + /// [`to_ne_bytes`]: #method.to_ne_bytes /// /// # Examples /// @@ -864,8 +864,8 @@ impl f32 { /// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as /// appropriate instead. /// - /// [`from_be_bytes`]: prim@f32::from_be_bytes() - /// [`from_le_bytes`]: prim@f32::from_le_bytes() + /// [`from_be_bytes`]: #method.from_be_bytes + /// [`from_le_bytes`]: #method.from_le_bytes /// /// # Examples /// diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs index 271671d14ef25..b85e8deb6d22c 100644 --- a/library/core/src/num/f64.rs +++ b/library/core/src/num/f64.rs @@ -790,8 +790,8 @@ impl f64 { /// As the target platform's native endianness is used, portable code /// should use [`to_be_bytes`] or [`to_le_bytes`], as appropriate, instead. /// - /// [`to_be_bytes`]: prim@f64::to_be_bytes() - /// [`to_le_bytes`]: prim@f64::to_le_bytes() + /// [`to_be_bytes`]: #method.to_be_bytes + /// [`to_le_bytes`]: #method.to_le_bytes /// /// # Examples /// @@ -818,7 +818,7 @@ impl f64 { /// /// [`to_ne_bytes`] should be preferred over this whenever possible. /// - /// [`to_ne_bytes`]: prim@f64::to_ne_bytes() + /// [`to_ne_bytes`]: #method.to_ne_bytes /// /// # Examples /// @@ -878,8 +878,8 @@ impl f64 { /// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as /// appropriate instead. /// - /// [`from_be_bytes`]: prim@f64::from_be_bytes() - /// [`from_le_bytes`]: prim@f64::from_le_bytes() + /// [`from_be_bytes`]: #method.from_be_bytes + /// [`from_le_bytes`]: #method.from_le_bytes /// /// # Examples /// diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index c5a2a70c4f9d5..a944514f694b6 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -2254,7 +2254,7 @@ impl str { /// To return a new uppercased value without modifying the existing one, use /// [`to_ascii_uppercase()`]. /// - /// [`to_ascii_uppercase()`]: prim@str::to_ascii_uppercase() + /// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase /// /// # Examples /// @@ -2281,7 +2281,7 @@ impl str { /// To return a new lowercased value without modifying the existing one, use /// [`to_ascii_lowercase()`]. /// - /// [`to_ascii_lowercase()`]: prim@str::to_ascii_lowercase() + /// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase /// /// # Examples ///