Skip to content

Commit becec6d

Browse files
committed
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`
2 parents b7ebc6b + 5bdd640 commit becec6d

File tree

7 files changed

+47
-53
lines changed

7 files changed

+47
-53
lines changed

library/core/src/cell.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ impl<T: ?Sized> RefCell<T> {
929929
/// Also, please be aware that this method is only for special circumstances and is usually
930930
/// not what you want. In case of doubt, use [`borrow_mut`] instead.
931931
///
932-
/// [`borrow_mut`]: #method.borrow_mut
932+
/// [`borrow_mut`]: RefCell::borrow_mut()
933933
///
934934
/// # Examples
935935
///
@@ -953,7 +953,7 @@ impl<T: ?Sized> RefCell<T> {
953953
/// ensure no borrows exist and then resets the state tracking shared borrows. This is relevant
954954
/// if some `Ref` or `RefMut` borrows have been leaked.
955955
///
956-
/// [`get_mut`]: #method.get_mut
956+
/// [`get_mut`]: RefCell::get_mut()
957957
///
958958
/// # Examples
959959
///
@@ -1745,7 +1745,7 @@ impl<T: ?Sized> UnsafeCell<T> {
17451745
/// when casting to `&mut T`, and ensure that there are no mutations
17461746
/// or mutable aliases going on when casting to `&T`.
17471747
///
1748-
/// [`get`]: #method.get
1748+
/// [`get`]: UnsafeCell::get()
17491749
///
17501750
/// # Examples
17511751
///

library/core/src/char/methods.rs

+19-24
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ impl char {
109109
/// `char`s. `from_u32()` will return `None` if the input is not a valid value
110110
/// for a `char`.
111111
///
112-
/// [`u32`]: primitive.u32.html
113-
///
114112
/// For an unsafe version of this function which ignores these checks, see
115113
/// [`from_u32_unchecked`].
116114
///
@@ -159,8 +157,6 @@ impl char {
159157
/// `char`s. `from_u32_unchecked()` will ignore this, and blindly cast to
160158
/// `char`, possibly creating an invalid one.
161159
///
162-
/// [`u32`]: primitive.u32.html
163-
///
164160
/// # Safety
165161
///
166162
/// This function is unsafe, as it may construct invalid `char` values.
@@ -249,7 +245,7 @@ impl char {
249245
/// sixteen, hexadecimal, to give some common values. Arbitrary
250246
/// radices are supported.
251247
///
252-
/// Compared to `is_numeric()`, this function only recognizes the characters
248+
/// Compared to [`is_numeric()`], this function only recognizes the characters
253249
/// `0-9`, `a-z` and `A-Z`.
254250
///
255251
/// 'Digit' is defined to be only the following characters:
@@ -258,9 +254,9 @@ impl char {
258254
/// * `a-z`
259255
/// * `A-Z`
260256
///
261-
/// For a more comprehensive understanding of 'digit', see [`is_numeric`][is_numeric].
257+
/// For a more comprehensive understanding of 'digit', see [`is_numeric()`].
262258
///
263-
/// [is_numeric]: #method.is_numeric
259+
/// [`is_numeric()`]: #method.is_numeric
264260
///
265261
/// # Panics
266262
///
@@ -483,9 +479,9 @@ impl char {
483479
/// * Any character in the 'printable ASCII' range `0x20` .. `0x7e`
484480
/// inclusive is not escaped.
485481
/// * All other characters are given hexadecimal Unicode escapes; see
486-
/// [`escape_unicode`][escape_unicode].
482+
/// [`escape_unicode`].
487483
///
488-
/// [escape_unicode]: #method.escape_unicode
484+
/// [`escape_unicode`]: #method.escape_unicode
489485
///
490486
/// # Examples
491487
///
@@ -504,7 +500,6 @@ impl char {
504500
/// println!("{}", '"'.escape_default());
505501
/// ```
506502
///
507-
///
508503
/// Both are equivalent to:
509504
///
510505
/// ```
@@ -584,10 +579,10 @@ impl char {
584579
/// Returns the number of 16-bit code units this `char` would need if
585580
/// encoded in UTF-16.
586581
///
587-
/// See the documentation for [`len_utf8`] for more explanation of this
582+
/// See the documentation for [`len_utf8()`] for more explanation of this
588583
/// concept. This function is a mirror, but for UTF-16 instead of UTF-8.
589584
///
590-
/// [`len_utf8`]: #method.len_utf8
585+
/// [`len_utf8()`]: #method.len_utf8
591586
///
592587
/// # Examples
593588
///
@@ -1075,10 +1070,10 @@ impl char {
10751070
/// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
10761071
/// but non-ASCII letters are unchanged.
10771072
///
1078-
/// To uppercase the value in-place, use [`make_ascii_uppercase`].
1073+
/// To uppercase the value in-place, use [`make_ascii_uppercase()`].
10791074
///
10801075
/// To uppercase ASCII characters in addition to non-ASCII characters, use
1081-
/// [`to_uppercase`].
1076+
/// [`to_uppercase()`].
10821077
///
10831078
/// # Examples
10841079
///
@@ -1090,8 +1085,8 @@ impl char {
10901085
/// assert_eq!('❤', non_ascii.to_ascii_uppercase());
10911086
/// ```
10921087
///
1093-
/// [`make_ascii_uppercase`]: #method.make_ascii_uppercase
1094-
/// [`to_uppercase`]: #method.to_uppercase
1088+
/// [`make_ascii_uppercase()`]: #method.make_ascii_uppercase
1089+
/// [`to_uppercase()`]: #method.to_uppercase
10951090
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
10961091
#[inline]
10971092
pub fn to_ascii_uppercase(&self) -> char {
@@ -1103,10 +1098,10 @@ impl char {
11031098
/// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
11041099
/// but non-ASCII letters are unchanged.
11051100
///
1106-
/// To lowercase the value in-place, use [`make_ascii_lowercase`].
1101+
/// To lowercase the value in-place, use [`make_ascii_lowercase()`].
11071102
///
11081103
/// To lowercase ASCII characters in addition to non-ASCII characters, use
1109-
/// [`to_lowercase`].
1104+
/// [`to_lowercase()`].
11101105
///
11111106
/// # Examples
11121107
///
@@ -1118,8 +1113,8 @@ impl char {
11181113
/// assert_eq!('❤', non_ascii.to_ascii_lowercase());
11191114
/// ```
11201115
///
1121-
/// [`make_ascii_lowercase`]: #method.make_ascii_lowercase
1122-
/// [`to_lowercase`]: #method.to_lowercase
1116+
/// [`make_ascii_lowercase()`]: #method.make_ascii_lowercase
1117+
/// [`to_lowercase()`]: #method.to_lowercase
11231118
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
11241119
#[inline]
11251120
pub fn to_ascii_lowercase(&self) -> char {
@@ -1153,7 +1148,7 @@ impl char {
11531148
/// but non-ASCII letters are unchanged.
11541149
///
11551150
/// To return a new uppercased value without modifying the existing one, use
1156-
/// [`to_ascii_uppercase`].
1151+
/// [`to_ascii_uppercase()`].
11571152
///
11581153
/// # Examples
11591154
///
@@ -1165,7 +1160,7 @@ impl char {
11651160
/// assert_eq!('A', ascii);
11661161
/// ```
11671162
///
1168-
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
1163+
/// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase
11691164
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
11701165
#[inline]
11711166
pub fn make_ascii_uppercase(&mut self) {
@@ -1178,7 +1173,7 @@ impl char {
11781173
/// but non-ASCII letters are unchanged.
11791174
///
11801175
/// To return a new lowercased value without modifying the existing one, use
1181-
/// [`to_ascii_lowercase`].
1176+
/// [`to_ascii_lowercase()`].
11821177
///
11831178
/// # Examples
11841179
///
@@ -1190,7 +1185,7 @@ impl char {
11901185
/// assert_eq!('a', ascii);
11911186
/// ```
11921187
///
1193-
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
1188+
/// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase
11941189
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
11951190
#[inline]
11961191
pub fn make_ascii_lowercase(&mut self) {

library/core/src/iter/adapters/flatten.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ where
120120
/// This `struct` is created by the [`flatten`] method on [`Iterator`]. See its
121121
/// documentation for more.
122122
///
123-
/// [`flatten`]: Iterator::flatten
124-
/// [`Iterator`]: trait.Iterator.html
123+
/// [`flatten`]: Iterator::flatten()
125124
#[must_use = "iterators are lazy and do nothing unless consumed"]
126125
#[stable(feature = "iterator_flatten", since = "1.29.0")]
127126
pub struct Flatten<I: Iterator<Item: IntoIterator>> {

library/core/src/iter/adapters/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub unsafe trait SourceIter {
110110
/// * whatever remains in the source after iteration has stopped
111111
/// * the memory that has become unused by advancing a consuming iterator
112112
///
113-
/// [`next()`]: Iterator::next
113+
/// [`next()`]: Iterator::next()
114114
unsafe fn as_inner(&mut self) -> &mut Self::Source;
115115
}
116116

library/core/src/ptr/const_ptr.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ impl<T: ?Sized> *const T {
723723
///
724724
/// See [`ptr::read`] for safety concerns and examples.
725725
///
726-
/// [`ptr::read`]: ./ptr/fn.read.html
726+
/// [`ptr::read`]: crate::ptr::read()
727727
#[stable(feature = "pointer_methods", since = "1.26.0")]
728728
#[inline]
729729
pub unsafe fn read(self) -> T
@@ -743,7 +743,7 @@ impl<T: ?Sized> *const T {
743743
///
744744
/// See [`ptr::read_volatile`] for safety concerns and examples.
745745
///
746-
/// [`ptr::read_volatile`]: ./ptr/fn.read_volatile.html
746+
/// [`ptr::read_volatile`]: crate::ptr::read_volatile()
747747
#[stable(feature = "pointer_methods", since = "1.26.0")]
748748
#[inline]
749749
pub unsafe fn read_volatile(self) -> T
@@ -761,7 +761,7 @@ impl<T: ?Sized> *const T {
761761
///
762762
/// See [`ptr::read_unaligned`] for safety concerns and examples.
763763
///
764-
/// [`ptr::read_unaligned`]: ./ptr/fn.read_unaligned.html
764+
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
765765
#[stable(feature = "pointer_methods", since = "1.26.0")]
766766
#[inline]
767767
pub unsafe fn read_unaligned(self) -> T
@@ -779,7 +779,7 @@ impl<T: ?Sized> *const T {
779779
///
780780
/// See [`ptr::copy`] for safety concerns and examples.
781781
///
782-
/// [`ptr::copy`]: ./ptr/fn.copy.html
782+
/// [`ptr::copy`]: crate::ptr::copy()
783783
#[stable(feature = "pointer_methods", since = "1.26.0")]
784784
#[inline]
785785
pub unsafe fn copy_to(self, dest: *mut T, count: usize)
@@ -797,7 +797,7 @@ impl<T: ?Sized> *const T {
797797
///
798798
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
799799
///
800-
/// [`ptr::copy_nonoverlapping`]: ./ptr/fn.copy_nonoverlapping.html
800+
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
801801
#[stable(feature = "pointer_methods", since = "1.26.0")]
802802
#[inline]
803803
pub unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize)

library/core/src/ptr/mut_ptr.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ impl<T: ?Sized> *mut T {
830830
///
831831
/// See [`ptr::read`] for safety concerns and examples.
832832
///
833-
/// [`ptr::read`]: ./ptr/fn.read.html
833+
/// [`ptr::read`]: crate::ptr::read()
834834
#[stable(feature = "pointer_methods", since = "1.26.0")]
835835
#[inline]
836836
pub unsafe fn read(self) -> T
@@ -850,7 +850,7 @@ impl<T: ?Sized> *mut T {
850850
///
851851
/// See [`ptr::read_volatile`] for safety concerns and examples.
852852
///
853-
/// [`ptr::read_volatile`]: ./ptr/fn.read_volatile.html
853+
/// [`ptr::read_volatile`]: crate::ptr::read_volatile()
854854
#[stable(feature = "pointer_methods", since = "1.26.0")]
855855
#[inline]
856856
pub unsafe fn read_volatile(self) -> T
@@ -868,7 +868,7 @@ impl<T: ?Sized> *mut T {
868868
///
869869
/// See [`ptr::read_unaligned`] for safety concerns and examples.
870870
///
871-
/// [`ptr::read_unaligned`]: ./ptr/fn.read_unaligned.html
871+
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
872872
#[stable(feature = "pointer_methods", since = "1.26.0")]
873873
#[inline]
874874
pub unsafe fn read_unaligned(self) -> T
@@ -886,7 +886,7 @@ impl<T: ?Sized> *mut T {
886886
///
887887
/// See [`ptr::copy`] for safety concerns and examples.
888888
///
889-
/// [`ptr::copy`]: ./ptr/fn.copy.html
889+
/// [`ptr::copy`]: crate::ptr::copy()
890890
#[stable(feature = "pointer_methods", since = "1.26.0")]
891891
#[inline]
892892
pub unsafe fn copy_to(self, dest: *mut T, count: usize)
@@ -904,7 +904,7 @@ impl<T: ?Sized> *mut T {
904904
///
905905
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
906906
///
907-
/// [`ptr::copy_nonoverlapping`]: ./ptr/fn.copy_nonoverlapping.html
907+
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
908908
#[stable(feature = "pointer_methods", since = "1.26.0")]
909909
#[inline]
910910
pub unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize)
@@ -922,7 +922,7 @@ impl<T: ?Sized> *mut T {
922922
///
923923
/// See [`ptr::copy`] for safety concerns and examples.
924924
///
925-
/// [`ptr::copy`]: ./ptr/fn.copy.html
925+
/// [`ptr::copy`]: crate::ptr::copy()
926926
#[stable(feature = "pointer_methods", since = "1.26.0")]
927927
#[inline]
928928
pub unsafe fn copy_from(self, src: *const T, count: usize)
@@ -940,7 +940,7 @@ impl<T: ?Sized> *mut T {
940940
///
941941
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
942942
///
943-
/// [`ptr::copy_nonoverlapping`]: ./ptr/fn.copy_nonoverlapping.html
943+
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
944944
#[stable(feature = "pointer_methods", since = "1.26.0")]
945945
#[inline]
946946
pub unsafe fn copy_from_nonoverlapping(self, src: *const T, count: usize)
@@ -955,7 +955,7 @@ impl<T: ?Sized> *mut T {
955955
///
956956
/// See [`ptr::drop_in_place`] for safety concerns and examples.
957957
///
958-
/// [`ptr::drop_in_place`]: ./ptr/fn.drop_in_place.html
958+
/// [`ptr::drop_in_place`]: crate::ptr::drop_in_place()
959959
#[stable(feature = "pointer_methods", since = "1.26.0")]
960960
#[inline]
961961
pub unsafe fn drop_in_place(self) {
@@ -968,7 +968,7 @@ impl<T: ?Sized> *mut T {
968968
///
969969
/// See [`ptr::write`] for safety concerns and examples.
970970
///
971-
/// [`ptr::write`]: ./ptr/fn.write.html
971+
/// [`ptr::write`]: crate::ptr::write()
972972
#[stable(feature = "pointer_methods", since = "1.26.0")]
973973
#[inline]
974974
pub unsafe fn write(self, val: T)
@@ -984,7 +984,7 @@ impl<T: ?Sized> *mut T {
984984
///
985985
/// See [`ptr::write_bytes`] for safety concerns and examples.
986986
///
987-
/// [`ptr::write_bytes`]: ./ptr/fn.write_bytes.html
987+
/// [`ptr::write_bytes`]: crate::ptr::write_bytes()
988988
#[stable(feature = "pointer_methods", since = "1.26.0")]
989989
#[inline]
990990
pub unsafe fn write_bytes(self, val: u8, count: usize)
@@ -1004,7 +1004,7 @@ impl<T: ?Sized> *mut T {
10041004
///
10051005
/// See [`ptr::write_volatile`] for safety concerns and examples.
10061006
///
1007-
/// [`ptr::write_volatile`]: ./ptr/fn.write_volatile.html
1007+
/// [`ptr::write_volatile`]: crate::ptr::write_volatile()
10081008
#[stable(feature = "pointer_methods", since = "1.26.0")]
10091009
#[inline]
10101010
pub unsafe fn write_volatile(self, val: T)
@@ -1022,7 +1022,7 @@ impl<T: ?Sized> *mut T {
10221022
///
10231023
/// See [`ptr::write_unaligned`] for safety concerns and examples.
10241024
///
1025-
/// [`ptr::write_unaligned`]: ./ptr/fn.write_unaligned.html
1025+
/// [`ptr::write_unaligned`]: crate::ptr::write_unaligned()
10261026
#[stable(feature = "pointer_methods", since = "1.26.0")]
10271027
#[inline]
10281028
pub unsafe fn write_unaligned(self, val: T)
@@ -1038,7 +1038,7 @@ impl<T: ?Sized> *mut T {
10381038
///
10391039
/// See [`ptr::replace`] for safety concerns and examples.
10401040
///
1041-
/// [`ptr::replace`]: ./ptr/fn.replace.html
1041+
/// [`ptr::replace`]: crate::ptr::replace()
10421042
#[stable(feature = "pointer_methods", since = "1.26.0")]
10431043
#[inline]
10441044
pub unsafe fn replace(self, src: T) -> T
@@ -1055,7 +1055,7 @@ impl<T: ?Sized> *mut T {
10551055
///
10561056
/// See [`ptr::swap`] for safety concerns and examples.
10571057
///
1058-
/// [`ptr::swap`]: ./ptr/fn.swap.html
1058+
/// [`ptr::swap`]: crate::ptr::swap()
10591059
#[stable(feature = "pointer_methods", since = "1.26.0")]
10601060
#[inline]
10611061
pub unsafe fn swap(self, with: *mut T)

library/core/src/str/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2252,9 +2252,9 @@ impl str {
22522252
/// but non-ASCII letters are unchanged.
22532253
///
22542254
/// To return a new uppercased value without modifying the existing one, use
2255-
/// [`to_ascii_uppercase`].
2255+
/// [`to_ascii_uppercase()`].
22562256
///
2257-
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
2257+
/// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase
22582258
///
22592259
/// # Examples
22602260
///
@@ -2279,9 +2279,9 @@ impl str {
22792279
/// but non-ASCII letters are unchanged.
22802280
///
22812281
/// To return a new lowercased value without modifying the existing one, use
2282-
/// [`to_ascii_lowercase`].
2282+
/// [`to_ascii_lowercase()`].
22832283
///
2284-
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
2284+
/// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase
22852285
///
22862286
/// # Examples
22872287
///

0 commit comments

Comments
 (0)