Skip to content

Commit 0876f59

Browse files
committed
Auto merge of rust-lang#77832 - camelid:remove-manual-link-resolves, r=jyn514
Remove many unnecessary manual link resolves from library Now that rust-lang#76934 has merged, we can remove a lot of these! E.g, this is no longer necessary: [`Vec<T>`]: Vec cc `@jyn514`
2 parents 417fe47 + 0506789 commit 0876f59

File tree

13 files changed

+0
-37
lines changed

13 files changed

+0
-37
lines changed

library/alloc/src/boxed.rs

-2
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@
126126
//!
127127
//! [ucg#198]: https://github.com/rust-lang/unsafe-code-guidelines/issues/198
128128
//! [dereferencing]: core::ops::Deref
129-
//! [`Box<T>`]: Box
130129
//! [`Box::<T>::from_raw(value)`]: Box::from_raw
131-
//! [`Box::<T>::into_raw`]: Box::into_raw
132130
//! [`Global`]: crate::alloc::Global
133131
//! [`Layout`]: crate::alloc::Layout
134132
//! [`Layout::for_value(&*value)`]: crate::alloc::Layout::for_value

library/alloc/src/str.rs

-2
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,6 @@ impl str {
451451

452452
/// Converts a [`Box<str>`] into a [`String`] without copying or allocating.
453453
///
454-
/// [`Box<str>`]: Box
455-
///
456454
/// # Examples
457455
///
458456
/// Basic usage:

library/core/src/borrow.rs

-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
/// provide a reference to related type `T`, it is often better to use
4141
/// [`AsRef<T>`] as more types can safely implement it.
4242
///
43-
/// [`BorrowMut<T>`]: BorrowMut
4443
/// [`Box<T>`]: ../../std/boxed/struct.Box.html
4544
/// [`Mutex<T>`]: ../../std/sync/struct.Mutex.html
4645
/// [`Rc<T>`]: ../../std/rc/struct.Rc.html
@@ -183,8 +182,6 @@ pub trait Borrow<Borrowed: ?Sized> {
183182
/// As a companion to [`Borrow<T>`] this trait allows a type to borrow as
184183
/// an underlying type by providing a mutable reference. See [`Borrow<T>`]
185184
/// for more information on borrowing as another type.
186-
///
187-
/// [`Borrow<T>`]: Borrow
188185
#[stable(feature = "rust1", since = "1.0.0")]
189186
pub trait BorrowMut<Borrowed: ?Sized>: Borrow<Borrowed> {
190187
/// Mutably borrows from an owned value.

library/core/src/convert/mod.rs

-9
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ pub const fn identity<T>(x: T) -> T {
135135
/// Since both [`String`] and [`&str`] implement `AsRef<str>` we can accept both as input argument.
136136
///
137137
/// [`&str`]: primitive@str
138-
/// [`Option<T>`]: Option
139-
/// [`Result<T, E>`]: Result
140138
/// [`Borrow`]: crate::borrow::Borrow
141139
/// [`Eq`]: crate::cmp::Eq
142140
/// [`Ord`]: crate::cmp::Ord
@@ -169,9 +167,6 @@ pub trait AsRef<T: ?Sized> {
169167
/// **Note: This trait must not fail**. If the conversion can fail, use a
170168
/// dedicated method which returns an [`Option<T>`] or a [`Result<T, E>`].
171169
///
172-
/// [`Option<T>`]: Option
173-
/// [`Result<T, E>`]: Result
174-
///
175170
/// # Generic Implementations
176171
///
177172
/// - `AsMut` auto-dereferences if the inner type is a mutable reference
@@ -270,8 +265,6 @@ pub trait AsMut<T: ?Sized> {
270265
/// is_hello(s);
271266
/// ```
272267
///
273-
/// [`Option<T>`]: Option
274-
/// [`Result<T, E>`]: Result
275268
/// [`String`]: ../../std/string/struct.String.html
276269
/// [`Vec`]: ../../std/vec/struct.Vec.html
277270
#[stable(feature = "rust1", since = "1.0.0")]
@@ -359,8 +352,6 @@ pub trait Into<T>: Sized {
359352
/// }
360353
/// ```
361354
///
362-
/// [`Option<T>`]: Option
363-
/// [`Result<T, E>`]: Result
364355
/// [`String`]: ../../std/string/struct.String.html
365356
/// [`from`]: From::from
366357
/// [book]: ../../book/ch09-00-error-handling.html

library/core/src/iter/traits/iterator.rs

-2
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,6 @@ pub trait Iterator {
805805
/// assert_eq!(iter.next(), Some(5));
806806
/// assert_eq!(iter.next(), None);
807807
/// ```
808-
///
809-
/// [`Option<T>`]: Option
810808
#[inline]
811809
#[stable(feature = "rust1", since = "1.0.0")]
812810
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>

library/core/src/mem/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ pub unsafe fn zeroed<T>() -> T {
650650
/// (Notice that the rules around uninitialized integers are not finalized yet, but
651651
/// until they are, it is advisable to avoid them.)
652652
///
653-
/// [`MaybeUninit<T>`]: MaybeUninit
654653
/// [uninit]: MaybeUninit::uninit
655654
/// [assume_init]: MaybeUninit::assume_init
656655
/// [inv]: MaybeUninit#initialization-invariant

library/core/src/option.rs

-2
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@ impl<T> Option<T> {
512512
/// result of a function call, it is recommended to use [`ok_or_else`], which is
513513
/// lazily evaluated.
514514
///
515-
/// [`Result<T, E>`]: Result
516515
/// [`Ok(v)`]: Ok
517516
/// [`Err(err)`]: Err
518517
/// [`Some(v)`]: Some
@@ -539,7 +538,6 @@ impl<T> Option<T> {
539538
/// Transforms the `Option<T>` into a [`Result<T, E>`], mapping [`Some(v)`] to
540539
/// [`Ok(v)`] and [`None`] to [`Err(err())`].
541540
///
542-
/// [`Result<T, E>`]: Result
543541
/// [`Ok(v)`]: Ok
544542
/// [`Err(err())`]: Err
545543
/// [`Some(v)`]: Some

library/core/src/pin.rs

-2
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@
349349
//! mutable reference even when you just have [`Pin`]`<&mut Self>` (such as in your own
350350
//! [`poll`] implementation).
351351
//!
352-
//! [`Pin<P>`]: Pin
353352
//! [`Deref`]: crate::ops::Deref
354353
//! [`DerefMut`]: crate::ops::DerefMut
355354
//! [`mem::swap`]: crate::mem::swap
@@ -364,7 +363,6 @@
364363
//! [`RefCell<T>`]: crate::cell::RefCell
365364
//! [`drop`]: Drop::drop
366365
//! [`VecDeque<T>`]: ../../std/collections/struct.VecDeque.html
367-
//! [`Option<T>`]: Option
368366
//! [`Some(v)`]: Some
369367
//! [`ptr::write`]: crate::ptr::write
370368
//! [`Future`]: crate::future::Future

library/core/src/result.rs

-6
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,6 @@ impl<T, E> Result<T, E> {
368368
/// Converts `self` into an [`Option<T>`], consuming `self`,
369369
/// and discarding the error, if any.
370370
///
371-
/// [`Option<T>`]: Option
372-
///
373371
/// # Examples
374372
///
375373
/// Basic usage:
@@ -395,8 +393,6 @@ impl<T, E> Result<T, E> {
395393
/// Converts `self` into an [`Option<E>`], consuming `self`,
396394
/// and discarding the success value, if any.
397395
///
398-
/// [`Option<E>`]: Option
399-
///
400396
/// # Examples
401397
///
402398
/// Basic usage:
@@ -1009,8 +1005,6 @@ impl<T: fmt::Debug, E> Result<T, E> {
10091005
/// Panics if the value is an [`Ok`], with a custom panic message provided
10101006
/// by the [`Ok`]'s value.
10111007
///
1012-
///
1013-
///
10141008
/// # Examples
10151009
///
10161010
/// ```{.should_panic}

library/std/src/error.rs

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ use crate::string;
4242
/// via [`Error::source()`]. This makes it possible for the high-level
4343
/// module to provide its own errors while also revealing some of the
4444
/// implementation for debugging via `source` chains.
45-
///
46-
/// [`Result<T, E>`]: Result
4745
#[stable(feature = "rust1", since = "1.0.0")]
4846
pub trait Error: Debug + Display {
4947
/// The lower-level source of this error, if any.

library/std/src/io/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@
240240
//!
241241
//! [`File`]: crate::fs::File
242242
//! [`TcpStream`]: crate::net::TcpStream
243-
//! [`Vec<T>`]: Vec
244243
//! [`io::stdout`]: stdout
245244
//! [`io::Result`]: self::Result
246245
//! [`?` operator]: ../../book/appendix-02-operators.html
@@ -1984,7 +1983,6 @@ pub trait BufRead: Read {
19841983
/// also yielded an error.
19851984
///
19861985
/// [`io::Result`]: self::Result
1987-
/// [`Vec<u8>`]: Vec
19881986
/// [`read_until`]: BufRead::read_until
19891987
///
19901988
/// # Examples

library/std/src/path.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,6 @@ impl Path {
17751775
/// Any non-Unicode sequences are replaced with
17761776
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD].
17771777
///
1778-
/// [`Cow<str>`]: Cow
17791778
/// [U+FFFD]: super::char::REPLACEMENT_CHARACTER
17801779
///
17811780
/// # Examples

library/std/src/primitive_docs.rs

-3
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ mod prim_bool {}
184184
/// because `!` coerces to `Result<!, ConnectionError>` automatically.
185185
///
186186
/// [`String::from_str`]: str::FromStr::from_str
187-
/// [`Result<String, !>`]: Result
188-
/// [`Result<T, !>`]: Result
189-
/// [`Result<!, E>`]: Result
190187
/// [`String`]: string::String
191188
/// [`FromStr`]: str::FromStr
192189
///

0 commit comments

Comments
 (0)