Skip to content

Commit 911d0cb

Browse files
committed
Remove excessive linking
1 parent 5719d22 commit 911d0cb

File tree

4 files changed

+53
-58
lines changed

4 files changed

+53
-58
lines changed

library/core/src/array/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ impl<T, const N: usize> [T; N] {
310310
/// on large arrays or check the emitted code. Also try to avoid chained
311311
/// maps (e.g. `arr.map(...).map(...)`).
312312
///
313-
/// In many cases, you can instead use [`Iterator::map`] by calling [`.iter()`](slice::iter)
314-
/// or [`.into_iter()`](IntoIterator::into_iter) on your array. `[T; N]::map` is only necessary
315-
/// if you really need a new array of the same size as the result. Rust's lazy
313+
/// In many cases, you can instead use [`Iterator::map`] by calling `.iter()`
314+
/// or `.into_iter()` on your array. `[T; N]::map` is only necessary if you
315+
/// really need a new array of the same size as the result. Rust's lazy
316316
/// iterators tend to get optimized very well.
317317
///
318318
///

library/core/src/bool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
#[lang = "bool"]
44
impl bool {
5-
/// Returns <code>[Some]\(t)</code> if the `bool` is [`true`](keyword.true.html), or [`None`] otherwise.
5+
/// Returns `Some(t)` if the `bool` is [`true`](keyword.true.html), or `None` otherwise.
66
///
77
/// # Examples
88
///
@@ -18,7 +18,7 @@ impl bool {
1818
if self { Some(t) } else { None }
1919
}
2020

21-
/// Returns <code>[Some]\(f())</code> if the `bool` is [`true`](keyword.true.html), or [`None`] otherwise.
21+
/// Returns `Some` if the `bool` is [`true`](keyword.true.html), or `None` otherwise.
2222
///
2323
/// # Examples
2424
///

library/core/src/char/methods.rs

+29-31
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ impl char {
2929
pub const REPLACEMENT_CHARACTER: char = '\u{FFFD}';
3030

3131
/// The version of [Unicode](https://www.unicode.org/) that the Unicode parts of
32-
/// `char` and [`str`] methods are based on.
32+
/// `char` and `str` methods are based on.
3333
///
3434
/// New versions of Unicode are released regularly and subsequently all methods
3535
/// in the standard library depending on Unicode are updated. Therefore the
36-
/// behavior of some `char` and [`str`] methods and the value of this constant
36+
/// behavior of some `char` and `str` methods and the value of this constant
3737
/// changes over time. This is *not* considered to be a breaking change.
3838
///
3939
/// The version numbering scheme is explained in
@@ -42,7 +42,7 @@ impl char {
4242
pub const UNICODE_VERSION: (u8, u8, u8) = crate::unicode::UNICODE_VERSION;
4343

4444
/// Creates an iterator over the UTF-16 encoded code points in `iter`,
45-
/// returning unpaired surrogates as [`Err`]s.
45+
/// returning unpaired surrogates as `Err`s.
4646
///
4747
/// # Examples
4848
///
@@ -70,7 +70,7 @@ impl char {
7070
/// );
7171
/// ```
7272
///
73-
/// A lossy decoder can be obtained by replacing [`Err`] results with the replacement character:
73+
/// A lossy decoder can be obtained by replacing `Err` results with the replacement character:
7474
///
7575
/// ```
7676
/// use std::char::{decode_utf16, REPLACEMENT_CHARACTER};
@@ -93,7 +93,7 @@ impl char {
9393
super::decode::decode_utf16(iter)
9494
}
9595

96-
/// Converts a [`u32`] to a `char`.
96+
/// Converts a `u32` to a `char`.
9797
///
9898
/// Note that all `char`s are valid [`u32`]s, and can be cast to one with
9999
/// [`as`](keyword.as.html):
@@ -106,7 +106,7 @@ impl char {
106106
/// ```
107107
///
108108
/// However, the reverse is not true: not all valid [`u32`]s are valid
109-
/// `char`s. `from_u32()` will return [`None`] if the input is not a valid value
109+
/// `char`s. `from_u32()` will return `None` if the input is not a valid value
110110
/// for a `char`.
111111
///
112112
/// For an unsafe version of this function which ignores these checks, see
@@ -126,7 +126,7 @@ impl char {
126126
/// assert_eq!(Some('❤'), c);
127127
/// ```
128128
///
129-
/// Returning [`None`] when the input is not a valid `char`:
129+
/// Returning `None` when the input is not a valid `char`:
130130
///
131131
/// ```
132132
/// use std::char;
@@ -141,7 +141,7 @@ impl char {
141141
super::convert::from_u32(i)
142142
}
143143

144-
/// Converts a [`u32`] to a `char`, ignoring validity.
144+
/// Converts a `u32` to a `char`, ignoring validity.
145145
///
146146
/// Note that all `char`s are valid [`u32`]s, and can be cast to one with
147147
/// `as`:
@@ -190,7 +190,7 @@ impl char {
190190
/// sixteen, hexadecimal, to give some common values. Arbitrary
191191
/// radices are supported.
192192
///
193-
/// `from_digit()` will return [`None`] if the input is not a digit in
193+
/// `from_digit()` will return `None` if the input is not a digit in
194194
/// the given radix.
195195
///
196196
/// # Panics
@@ -214,7 +214,7 @@ impl char {
214214
/// assert_eq!(Some('b'), c);
215215
/// ```
216216
///
217-
/// Returning [`None`] when the input is not a digit:
217+
/// Returning `None` when the input is not a digit:
218218
///
219219
/// ```
220220
/// use std::char;
@@ -299,7 +299,7 @@ impl char {
299299
///
300300
/// # Errors
301301
///
302-
/// Returns [`None`] if the `char` does not refer to a digit in the given radix.
302+
/// Returns `None` if the `char` does not refer to a digit in the given radix.
303303
///
304304
/// # Panics
305305
///
@@ -360,7 +360,7 @@ impl char {
360360
/// println!();
361361
/// ```
362362
///
363-
/// Using [`println!`](macro.println.html) directly:
363+
/// Using `println! directly:
364364
///
365365
/// ```
366366
/// println!("{}", '❤'.escape_unicode());
@@ -423,7 +423,7 @@ impl char {
423423
/// as `char`s.
424424
///
425425
/// This will escape the characters similar to the [`Debug`](core::fmt::Debug) implementations
426-
/// of [`str`] or `char`.
426+
/// of `str` or `char`.
427427
///
428428
/// # Examples
429429
///
@@ -436,7 +436,7 @@ impl char {
436436
/// println!();
437437
/// ```
438438
///
439-
/// Using [`println!`](macro.println.html) directly:
439+
/// Using `println!` directly:
440440
///
441441
/// ```
442442
/// println!("{}", '\n'.escape_debug());
@@ -490,7 +490,7 @@ impl char {
490490
/// println!();
491491
/// ```
492492
///
493-
/// Using [`println!`](macro.println.html) directly:
493+
/// Using `println!` directly:
494494
///
495495
/// ```
496496
/// println!("{}", '"'.escape_default());
@@ -543,9 +543,8 @@ impl char {
543543
/// assert_eq!(len, 4);
544544
/// ```
545545
///
546-
/// The <code>[&](reference)[str]</code> type guarantees that its contents are UTF-8,
547-
/// and so we can compare the length it would take if each code point was represented
548-
/// as a `char` vs in the <code>[&](reference)[str]</code> itself:
546+
/// The `&str` type guarantees that its contents are UTF-8, and so we can compare the length it
547+
/// would take if each code point was represented as a `char` vs in the `&str` itself:
549548
///
550549
/// ```
551550
/// // as chars
@@ -638,7 +637,7 @@ impl char {
638637
unsafe { from_utf8_unchecked_mut(encode_utf8_raw(self as u32, dst)) }
639638
}
640639

641-
/// Encodes this character as UTF-16 into the provided [`u16`] buffer,
640+
/// Encodes this character as UTF-16 into the provided `u16` buffer,
642641
/// and then returns the subslice of the buffer that contains the encoded character.
643642
///
644643
/// # Panics
@@ -648,7 +647,7 @@ impl char {
648647
///
649648
/// # Examples
650649
///
651-
/// In both of these examples, '𝕊' takes two [`u16`]s to encode.
650+
/// In both of these examples, '𝕊' takes two `u16`s to encode.
652651
///
653652
/// ```
654653
/// let mut b = [0; 2];
@@ -672,7 +671,7 @@ impl char {
672671
encode_utf16_raw(self as u32, dst)
673672
}
674673

675-
/// Returns [`true`](keyword.true.html) if this `char` has the `Alphabetic` property.
674+
/// Returns `true` if this `char` has the `Alphabetic` property.
676675
///
677676
/// `Alphabetic` is described in Chapter 4 (Character Properties) of the [Unicode Standard] and
678677
/// specified in the [Unicode Character Database][ucd] [`DerivedCoreProperties.txt`].
@@ -702,7 +701,7 @@ impl char {
702701
}
703702
}
704703

705-
/// Returns [`true`](keyword.true.html) if this `char` has the `Lowercase` property.
704+
/// Returns `true` if this `char` has the `Lowercase` property.
706705
///
707706
/// `Lowercase` is described in Chapter 4 (Character Properties) of the [Unicode Standard] and
708707
/// specified in the [Unicode Character Database][ucd] [`DerivedCoreProperties.txt`].
@@ -734,7 +733,7 @@ impl char {
734733
}
735734
}
736735

737-
/// Returns [`true`](keyword.true.html) if this `char` has the `Uppercase` property.
736+
/// Returns `true` if this `char` has the `Uppercase` property.
738737
///
739738
/// `Uppercase` is described in Chapter 4 (Character Properties) of the [Unicode Standard] and
740739
/// specified in the [Unicode Character Database][ucd] [`DerivedCoreProperties.txt`].
@@ -766,7 +765,7 @@ impl char {
766765
}
767766
}
768767

769-
/// Returns [`true`](keyword.true.html) if this `char` has the `White_Space` property.
768+
/// Returns `true` if this `char` has the `White_Space` property.
770769
///
771770
/// `White_Space` is specified in the [Unicode Character Database][ucd] [`PropList.txt`].
772771
///
@@ -794,8 +793,7 @@ impl char {
794793
}
795794
}
796795

797-
/// Returns [`true`](keyword.true.html) if this `char` satisfies either
798-
/// [`is_alphabetic()`] or [`is_numeric()`].
796+
/// Returns `true` if this `char` satisfies either [`is_alphabetic()`] or [`is_numeric()`].
799797
///
800798
/// [`is_alphabetic()`]: #method.is_alphabetic
801799
/// [`is_numeric()`]: #method.is_numeric
@@ -820,7 +818,7 @@ impl char {
820818
self.is_alphabetic() || self.is_numeric()
821819
}
822820

823-
/// Returns [`true`](keyword.true.html) if this `char` has the general category for control codes.
821+
/// Returns `true` if this `char` has the general category for control codes.
824822
///
825823
/// Control codes (code points with the general category of `Cc`) are described in Chapter 4
826824
/// (Character Properties) of the [Unicode Standard] and specified in the [Unicode Character
@@ -845,7 +843,7 @@ impl char {
845843
unicode::Cc(self)
846844
}
847845

848-
/// Returns [`true`](keyword.true.html) if this `char` has the `Grapheme_Extend` property.
846+
/// Returns `true` if this `char` has the `Grapheme_Extend` property.
849847
///
850848
/// `Grapheme_Extend` is described in [Unicode Standard Annex #29 (Unicode Text
851849
/// Segmentation)][uax29] and specified in the [Unicode Character Database][ucd]
@@ -859,7 +857,7 @@ impl char {
859857
unicode::Grapheme_Extend(self)
860858
}
861859

862-
/// Returns [`true`](keyword.true.html) if this `char` has one of the general categories for numbers.
860+
/// Returns `true` if this `char` has one of the general categories for numbers.
863861
///
864862
/// The general categories for numbers (`Nd` for decimal digits, `Nl` for letter-like numeric
865863
/// characters, and `No` for other numeric characters) are specified in the [Unicode Character
@@ -927,7 +925,7 @@ impl char {
927925
/// println!();
928926
/// ```
929927
///
930-
/// Using [`println!`](macro.println.html) directly:
928+
/// Using `println!` directly:
931929
///
932930
/// ```
933931
/// println!("{}", 'İ'.to_lowercase());
@@ -992,7 +990,7 @@ impl char {
992990
/// println!();
993991
/// ```
994992
///
995-
/// Using [`println!`](macro.println.html) directly:
993+
/// Using `println!` directly:
996994
///
997995
/// ```
998996
/// println!("{}", 'ß'.to_uppercase());

library/std/src/primitive_docs.rs

+19-22
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,10 @@ mod prim_pointer {}
578578
/// # Editions
579579
///
580580
/// Prior to Rust 1.53, arrays did not implement [`IntoIterator`] by value, so the method call
581-
/// <code>array.[into_iter()]</code> auto-referenced into a slice iterator.
582-
/// Right now, the old behavior is preserved in the 2015 and 2018 editions of Rust for
583-
/// compatibility, ignoring [`IntoIterator`] by value. In the future, the behavior on the 2015 and
584-
/// 2018 edition might be made consistent to the behavior of later editions.
581+
/// `array.into_iter()` auto-referenced into a [slice iterator](slice::iter). Right now, the old behavior
582+
/// is preserved in the 2015 and 2018 editions of Rust for compatibility, ignoring
583+
/// `IntoIterator` by value. In the future, the behavior on the 2015 and 2018 edition
584+
/// might be made consistent to the behavior of later editions.
585585
///
586586
/// ```rust,edition2018
587587
/// # #![allow(array_into_iter)] // override our `deny(warnings)`
@@ -607,9 +607,8 @@ mod prim_pointer {}
607607
/// }
608608
/// ```
609609
///
610-
/// Starting in the 2021 edition, <code>array.[into_iter()]</code> will use [`IntoIterator`]
611-
/// normally to iterate by value, and [`iter()`](slice::iter) should be used to iterate by
612-
/// reference like previous editions.
610+
/// Starting in the 2021 edition, `array.into_iter()` will use `IntoIterator` normally to iterate
611+
/// by value, and `iter()` should be used to iterate by reference like previous editions.
613612
///
614613
/// ```rust,edition2021,ignore
615614
/// # // FIXME: ignored because 2021 testing is still unstable
@@ -628,16 +627,16 @@ mod prim_pointer {}
628627
/// }
629628
/// ```
630629
///
631-
/// Future language versions might start treating the <code>array.[into_iter()]</code>
630+
/// Future language versions might start treating the `array.into_iter()`
632631
/// syntax on editions 2015 and 2018 the same as on edition 2021. So code using
633632
/// those older editions should still be written with this change in mind, to
634633
/// prevent breakage in the future. The safest way to accomplish this is to
635-
/// avoid the [`into_iter`](IntoIterator::into_iter) syntax on those editions.
636-
/// If an edition update is not viable/desired, there are multiple alternatives:
637-
/// * use [`iter`](slice::iter), equivalent to the old behavior, creating references
634+
/// avoid the `into_iter` syntax on those editions. If an edition update is not
635+
/// viable/desired, there are multiple alternatives:
636+
/// * use `iter`, equivalent to the old behavior, creating references
638637
/// * use [`array::IntoIter`], equivalent to the post-2021 behavior (Rust 1.51+)
639-
/// * replace <code>[for] ... [in] array.[into_iter()] {</code>` with
640-
/// <code>[for] ... [in] array {</code>, equivalent to the post-2021 behavior (Rust 1.53+)
638+
/// * replace `for ... in array.into_iter() {` with `for ... in array {`,
639+
/// equivalent to the post-2021 behavior (Rust 1.53+)
641640
///
642641
/// ```rust,edition2018
643642
/// use std::array::IntoIter;
@@ -676,9 +675,6 @@ mod prim_pointer {}
676675
/// [`Borrow`]: borrow::Borrow
677676
/// [`BorrowMut`]: borrow::BorrowMut
678677
/// [slice pattern]: ../reference/patterns.html#slice-patterns
679-
/// [into_iter()]: IntoIterator::into_iter
680-
/// [for]: keyword.for.html
681-
/// [in]: keyword.in.html
682678
#[stable(feature = "rust1", since = "1.0.0")]
683679
mod prim_array {}
684680

@@ -1097,7 +1093,7 @@ mod prim_usize {}
10971093
/// The following traits are implemented for all `&T`, regardless of the type of its referent:
10981094
///
10991095
/// * [`Copy`]
1100-
/// * [`Clone`] \(Note that this will not defer to `T`'s [`Clone`] implementation if it exists!)
1096+
/// * [`Clone`] \(Note that this will not defer to `T`'s `Clone` implementation if it exists!)
11011097
/// * [`Deref`]
11021098
/// * [`Borrow`]
11031099
/// * [`Pointer`]
@@ -1106,7 +1102,7 @@ mod prim_usize {}
11061102
/// [`Borrow`]: borrow::Borrow
11071103
/// [`Pointer`]: fmt::Pointer
11081104
///
1109-
/// `&mut T` references get all of the above except [`Copy`] and [`Clone`] (to prevent creating
1105+
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
11101106
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
11111107
/// referent:
11121108
///
@@ -1134,18 +1130,18 @@ mod prim_usize {}
11341130
/// [`Hash`]: hash::Hash
11351131
/// [`ToSocketAddrs`]: net::ToSocketAddrs
11361132
///
1137-
/// `&mut T` references get all of the above except [`ToSocketAddrs`], plus the following, if `T`
1133+
/// `&mut T` references get all of the above except `ToSocketAddrs`, plus the following, if `T`
11381134
/// implements that trait:
11391135
///
11401136
/// * [`AsMut`]
1141-
/// * [`FnMut`] \(in addition, `&mut T` references get [`FnOnce`] if <code>T: [FnMut]</code>)
1137+
/// * [`FnMut`] \(in addition, `&mut T` references get [`FnOnce`] if `T: FnMut`)
11421138
/// * [`fmt::Write`]
11431139
/// * [`Iterator`]
11441140
/// * [`DoubleEndedIterator`]
11451141
/// * [`ExactSizeIterator`]
11461142
/// * [`FusedIterator`]
11471143
/// * [`TrustedLen`]
1148-
/// * [`Send`] \(note that `&T` references only get [`Send`] if <code>T: [Sync]</code>)
1144+
/// * [`Send`] \(note that `&T` references only get `Send` if <code>T: [Sync]</code>)
11491145
/// * [`io::Write`]
11501146
/// * [`Read`]
11511147
/// * [`Seek`]
@@ -1177,7 +1173,8 @@ mod prim_ref {}
11771173
/// Function pointers are pointers that point to *code*, not data. They can be called
11781174
/// just like functions. Like references, function pointers are, among other things, assumed to
11791175
/// not be null, so if you want to pass a function pointer over FFI and be able to accommodate null
1180-
/// pointers, make your type <code>[Option]\<fn()></code> with your required signature.
1176+
/// pointers, make your type [`Option<fn()>`](core::option#options-and-pointers-nullable-pointers)
1177+
/// with your required signature.
11811178
///
11821179
/// ### Safety
11831180
///

0 commit comments

Comments
 (0)