Skip to content

Commit 96975e5

Browse files
authored
Rollup merge of #78852 - camelid:intra-doc-bonanza, r=jyn514
Convert a bunch of intra-doc links An intra-doc link bonanza! This was accomplished using a bunch of trial-and-error with sed.
2 parents e5230fd + 8258cf2 commit 96975e5

File tree

12 files changed

+55
-71
lines changed

12 files changed

+55
-71
lines changed

library/alloc/src/fmt.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,13 @@
309309
//! * `?` ⇒ [`Debug`]
310310
//! * `x?` ⇒ [`Debug`] with lower-case hexadecimal integers
311311
//! * `X?` ⇒ [`Debug`] with upper-case hexadecimal integers
312-
//! * `o` ⇒ [`Octal`](trait.Octal.html)
313-
//! * `x` ⇒ [`LowerHex`](trait.LowerHex.html)
314-
//! * `X` ⇒ [`UpperHex`](trait.UpperHex.html)
315-
//! * `p` ⇒ [`Pointer`](trait.Pointer.html)
312+
//! * `o` ⇒ [`Octal`]
313+
//! * `x` ⇒ [`LowerHex`]
314+
//! * `X` ⇒ [`UpperHex`]
315+
//! * `p` ⇒ [`Pointer`]
316316
//! * `b` ⇒ [`Binary`]
317-
//! * `e` ⇒ [`LowerExp`](trait.LowerExp.html)
318-
//! * `E` ⇒ [`UpperExp`](trait.UpperExp.html)
317+
//! * `e` ⇒ [`LowerExp`]
318+
//! * `E` ⇒ [`UpperExp`]
319319
//!
320320
//! What this means is that any type of argument which implements the
321321
//! [`fmt::Binary`][`Binary`] trait can then be formatted with `{:b}`. Implementations

library/core/src/cell.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ pub struct RefCell<T: ?Sized> {
574574
value: UnsafeCell<T>,
575575
}
576576

577-
/// An error returned by [`RefCell::try_borrow`](struct.RefCell.html#method.try_borrow).
577+
/// An error returned by [`RefCell::try_borrow`].
578578
#[stable(feature = "try_borrow", since = "1.13.0")]
579579
pub struct BorrowError {
580580
_private: (),
@@ -594,7 +594,7 @@ impl Display for BorrowError {
594594
}
595595
}
596596

597-
/// An error returned by [`RefCell::try_borrow_mut`](struct.RefCell.html#method.try_borrow_mut).
597+
/// An error returned by [`RefCell::try_borrow_mut`].
598598
#[stable(feature = "try_borrow", since = "1.13.0")]
599599
pub struct BorrowMutError {
600600
_private: (),

library/core/src/cmp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use self::Ordering::*;
2929
///
3030
/// This trait allows for partial equality, for types that do not have a full
3131
/// equivalence relation. For example, in floating point numbers `NaN != NaN`,
32-
/// so floating point types implement `PartialEq` but not [`Eq`](Eq).
32+
/// so floating point types implement `PartialEq` but not [`Eq`].
3333
///
3434
/// Formally, the equality must be (for all `a`, `b` and `c`):
3535
///

library/core/src/fmt/builders.rs

+18-26
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use crate::fmt;
1+
#![allow(unused_imports)]
2+
3+
use crate::fmt::{self, Debug, Formatter};
24

35
struct PadAdapter<'buf, 'state> {
46
buf: &'buf mut (dyn fmt::Write + 'buf),
@@ -53,14 +55,12 @@ impl fmt::Write for PadAdapter<'_, '_> {
5355
}
5456
}
5557

56-
/// A struct to help with [`fmt::Debug`](trait.Debug.html) implementations.
58+
/// A struct to help with [`fmt::Debug`](Debug) implementations.
5759
///
5860
/// This is useful when you wish to output a formatted struct as a part of your
59-
/// [`Debug::fmt`](trait.Debug.html#tymethod.fmt) implementation.
61+
/// [`Debug::fmt`] implementation.
6062
///
61-
/// This can be constructed by the
62-
/// [`Formatter::debug_struct`](struct.Formatter.html#method.debug_struct)
63-
/// method.
63+
/// This can be constructed by the [`Formatter::debug_struct`] method.
6464
///
6565
/// # Examples
6666
///
@@ -257,14 +257,12 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
257257
}
258258
}
259259

260-
/// A struct to help with [`fmt::Debug`](trait.Debug.html) implementations.
260+
/// A struct to help with [`fmt::Debug`](Debug) implementations.
261261
///
262262
/// This is useful when you wish to output a formatted tuple as a part of your
263-
/// [`Debug::fmt`](trait.Debug.html#tymethod.fmt) implementation.
263+
/// [`Debug::fmt`] implementation.
264264
///
265-
/// This can be constructed by the
266-
/// [`Formatter::debug_tuple`](struct.Formatter.html#method.debug_tuple)
267-
/// method.
265+
/// This can be constructed by the [`Formatter::debug_tuple`] method.
268266
///
269267
/// # Examples
270268
///
@@ -428,14 +426,12 @@ impl<'a, 'b: 'a> DebugInner<'a, 'b> {
428426
}
429427
}
430428

431-
/// A struct to help with [`fmt::Debug`](trait.Debug.html) implementations.
429+
/// A struct to help with [`fmt::Debug`](Debug) implementations.
432430
///
433431
/// This is useful when you wish to output a formatted set of items as a part
434-
/// of your [`Debug::fmt`](trait.Debug.html#tymethod.fmt) implementation.
432+
/// of your [`Debug::fmt`] implementation.
435433
///
436-
/// This can be constructed by the
437-
/// [`Formatter::debug_set`](struct.Formatter.html#method.debug_set)
438-
/// method.
434+
/// This can be constructed by the [`Formatter::debug_set`] method.
439435
///
440436
/// # Examples
441437
///
@@ -560,14 +556,12 @@ impl<'a, 'b: 'a> DebugSet<'a, 'b> {
560556
}
561557
}
562558

563-
/// A struct to help with [`fmt::Debug`](trait.Debug.html) implementations.
559+
/// A struct to help with [`fmt::Debug`](Debug) implementations.
564560
///
565561
/// This is useful when you wish to output a formatted list of items as a part
566-
/// of your [`Debug::fmt`](trait.Debug.html#tymethod.fmt) implementation.
562+
/// of your [`Debug::fmt`] implementation.
567563
///
568-
/// This can be constructed by the
569-
/// [`Formatter::debug_list`](struct.Formatter.html#method.debug_list)
570-
/// method.
564+
/// This can be constructed by the [`Formatter::debug_list`] method.
571565
///
572566
/// # Examples
573567
///
@@ -692,14 +686,12 @@ impl<'a, 'b: 'a> DebugList<'a, 'b> {
692686
}
693687
}
694688

695-
/// A struct to help with [`fmt::Debug`](trait.Debug.html) implementations.
689+
/// A struct to help with [`fmt::Debug`](Debug) implementations.
696690
///
697691
/// This is useful when you wish to output a formatted map as a part of your
698-
/// [`Debug::fmt`](trait.Debug.html#tymethod.fmt) implementation.
692+
/// [`Debug::fmt`] implementation.
699693
///
700-
/// This can be constructed by the
701-
/// [`Formatter::debug_map`](struct.Formatter.html#method.debug_map)
702-
/// method.
694+
/// This can be constructed by the [`Formatter::debug_map`] method.
703695
///
704696
/// # Examples
705697
///

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ where
121121
/// This `struct` is created by the [`flatten`] method on [`Iterator`]. See its
122122
/// documentation for more.
123123
///
124-
/// [`flatten`]: trait.Iterator.html#method.flatten
124+
/// [`flatten`]: Iterator::flatten
125125
/// [`Iterator`]: trait.Iterator.html
126126
#[must_use = "iterators are lazy and do nothing unless consumed"]
127127
#[stable(feature = "iterator_flatten", since = "1.29.0")]

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

+19-19
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub unsafe trait SourceIter {
8585
/// * whatever remains in the source after iteration has stopped
8686
/// * the memory that has become unused by advancing a consuming iterator
8787
///
88-
/// [`next()`]: trait.Iterator.html#method.next
88+
/// [`next()`]: Iterator::next
8989
unsafe fn as_inner(&mut self) -> &mut Self::Source;
9090
}
9191

@@ -94,7 +94,7 @@ pub unsafe trait SourceIter {
9494
/// This `struct` is created by the [`rev`] method on [`Iterator`]. See its
9595
/// documentation for more.
9696
///
97-
/// [`rev`]: trait.Iterator.html#method.rev
97+
/// [`rev`]: Iterator::rev
9898
/// [`Iterator`]: trait.Iterator.html
9999
#[derive(Clone, Debug)]
100100
#[must_use = "iterators are lazy and do nothing unless consumed"]
@@ -228,7 +228,7 @@ unsafe impl<I> TrustedLen for Rev<I> where I: TrustedLen + DoubleEndedIterator {
228228
/// This `struct` is created by the [`copied`] method on [`Iterator`]. See its
229229
/// documentation for more.
230230
///
231-
/// [`copied`]: trait.Iterator.html#method.copied
231+
/// [`copied`]: Iterator::copied
232232
/// [`Iterator`]: trait.Iterator.html
233233
#[stable(feature = "iter_copied", since = "1.36.0")]
234234
#[must_use = "iterators are lazy and do nothing unless consumed"]
@@ -380,7 +380,7 @@ where
380380
/// This `struct` is created by the [`cloned`] method on [`Iterator`]. See its
381381
/// documentation for more.
382382
///
383-
/// [`cloned`]: trait.Iterator.html#method.cloned
383+
/// [`cloned`]: Iterator::cloned
384384
/// [`Iterator`]: trait.Iterator.html
385385
#[stable(feature = "iter_cloned", since = "1.1.0")]
386386
#[must_use = "iterators are lazy and do nothing unless consumed"]
@@ -515,7 +515,7 @@ where
515515
/// This `struct` is created by the [`cycle`] method on [`Iterator`]. See its
516516
/// documentation for more.
517517
///
518-
/// [`cycle`]: trait.Iterator.html#method.cycle
518+
/// [`cycle`]: Iterator::cycle
519519
/// [`Iterator`]: trait.Iterator.html
520520
#[derive(Clone, Debug)]
521521
#[must_use = "iterators are lazy and do nothing unless consumed"]
@@ -600,7 +600,7 @@ impl<I> FusedIterator for Cycle<I> where I: Clone + Iterator {}
600600
/// This `struct` is created by the [`step_by`] method on [`Iterator`]. See
601601
/// its documentation for more.
602602
///
603-
/// [`step_by`]: trait.Iterator.html#method.step_by
603+
/// [`step_by`]: Iterator::step_by
604604
/// [`Iterator`]: trait.Iterator.html
605605
#[must_use = "iterators are lazy and do nothing unless consumed"]
606606
#[stable(feature = "iterator_step_by", since = "1.28.0")]
@@ -833,7 +833,7 @@ impl<I> ExactSizeIterator for StepBy<I> where I: ExactSizeIterator {}
833833
/// This `struct` is created by the [`map`] method on [`Iterator`]. See its
834834
/// documentation for more.
835835
///
836-
/// [`map`]: trait.Iterator.html#method.map
836+
/// [`map`]: Iterator::map
837837
/// [`Iterator`]: trait.Iterator.html
838838
///
839839
/// # Notes about side effects
@@ -1042,7 +1042,7 @@ unsafe impl<B, I: InPlaceIterable, F> InPlaceIterable for Map<I, F> where F: FnM
10421042
/// This `struct` is created by the [`filter`] method on [`Iterator`]. See its
10431043
/// documentation for more.
10441044
///
1045-
/// [`filter`]: trait.Iterator.html#method.filter
1045+
/// [`filter`]: Iterator::filter
10461046
/// [`Iterator`]: trait.Iterator.html
10471047
#[must_use = "iterators are lazy and do nothing unless consumed"]
10481048
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1191,7 +1191,7 @@ unsafe impl<I: InPlaceIterable, P> InPlaceIterable for Filter<I, P> where P: FnM
11911191
/// This `struct` is created by the [`filter_map`] method on [`Iterator`]. See its
11921192
/// documentation for more.
11931193
///
1194-
/// [`filter_map`]: trait.Iterator.html#method.filter_map
1194+
/// [`filter_map`]: Iterator::filter_map
11951195
/// [`Iterator`]: trait.Iterator.html
11961196
#[must_use = "iterators are lazy and do nothing unless consumed"]
11971197
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1338,7 +1338,7 @@ unsafe impl<B, I: InPlaceIterable, F> InPlaceIterable for FilterMap<I, F> where
13381338
/// This `struct` is created by the [`enumerate`] method on [`Iterator`]. See its
13391339
/// documentation for more.
13401340
///
1341-
/// [`enumerate`]: trait.Iterator.html#method.enumerate
1341+
/// [`enumerate`]: Iterator::enumerate
13421342
/// [`Iterator`]: trait.Iterator.html
13431343
#[derive(Clone, Debug)]
13441344
#[must_use = "iterators are lazy and do nothing unless consumed"]
@@ -1574,7 +1574,7 @@ unsafe impl<I: InPlaceIterable> InPlaceIterable for Enumerate<I> {}
15741574
/// This `struct` is created by the [`peekable`] method on [`Iterator`]. See its
15751575
/// documentation for more.
15761576
///
1577-
/// [`peekable`]: trait.Iterator.html#method.peekable
1577+
/// [`peekable`]: Iterator::peekable
15781578
/// [`Iterator`]: trait.Iterator.html
15791579
#[derive(Clone, Debug)]
15801580
#[must_use = "iterators are lazy and do nothing unless consumed"]
@@ -1743,7 +1743,7 @@ impl<I: Iterator> Peekable<I> {
17431743
/// Like [`next`], if there is a value, it is wrapped in a `Some(T)`.
17441744
/// But if the iteration is over, `None` is returned.
17451745
///
1746-
/// [`next`]: trait.Iterator.html#tymethod.next
1746+
/// [`next`]: Iterator::next
17471747
///
17481748
/// Because `peek()` returns a reference, and many iterators iterate over
17491749
/// references, there can be a possibly confusing situation where the
@@ -1871,7 +1871,7 @@ unsafe impl<I: InPlaceIterable> InPlaceIterable for Peekable<I> {}
18711871
/// This `struct` is created by the [`skip_while`] method on [`Iterator`]. See its
18721872
/// documentation for more.
18731873
///
1874-
/// [`skip_while`]: trait.Iterator.html#method.skip_while
1874+
/// [`skip_while`]: Iterator::skip_while
18751875
/// [`Iterator`]: trait.Iterator.html
18761876
#[must_use = "iterators are lazy and do nothing unless consumed"]
18771877
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1993,7 +1993,7 @@ unsafe impl<I: InPlaceIterable, F> InPlaceIterable for SkipWhile<I, F> where
19931993
/// This `struct` is created by the [`take_while`] method on [`Iterator`]. See its
19941994
/// documentation for more.
19951995
///
1996-
/// [`take_while`]: trait.Iterator.html#method.take_while
1996+
/// [`take_while`]: Iterator::take_while
19971997
/// [`Iterator`]: trait.Iterator.html
19981998
#[must_use = "iterators are lazy and do nothing unless consumed"]
19991999
#[stable(feature = "rust1", since = "1.0.0")]
@@ -2128,7 +2128,7 @@ unsafe impl<I: InPlaceIterable, F> InPlaceIterable for TakeWhile<I, F> where
21282128
/// This `struct` is created by the [`map_while`] method on [`Iterator`]. See its
21292129
/// documentation for more.
21302130
///
2131-
/// [`map_while`]: trait.Iterator.html#method.map_while
2131+
/// [`map_while`]: Iterator::map_while
21322132
/// [`Iterator`]: trait.Iterator.html
21332133
#[must_use = "iterators are lazy and do nothing unless consumed"]
21342134
#[unstable(feature = "iter_map_while", reason = "recently added", issue = "68537")]
@@ -2226,7 +2226,7 @@ unsafe impl<B, I: InPlaceIterable, P> InPlaceIterable for MapWhile<I, P> where
22262226
/// This `struct` is created by the [`skip`] method on [`Iterator`]. See its
22272227
/// documentation for more.
22282228
///
2229-
/// [`skip`]: trait.Iterator.html#method.skip
2229+
/// [`skip`]: Iterator::skip
22302230
/// [`Iterator`]: trait.Iterator.html
22312231
#[derive(Clone, Debug)]
22322232
#[must_use = "iterators are lazy and do nothing unless consumed"]
@@ -2422,7 +2422,7 @@ unsafe impl<I: InPlaceIterable> InPlaceIterable for Skip<I> {}
24222422
/// This `struct` is created by the [`take`] method on [`Iterator`]. See its
24232423
/// documentation for more.
24242424
///
2425-
/// [`take`]: trait.Iterator.html#method.take
2425+
/// [`take`]: Iterator::take
24262426
/// [`Iterator`]: trait.Iterator.html
24272427
#[derive(Clone, Debug)]
24282428
#[must_use = "iterators are lazy and do nothing unless consumed"]
@@ -2627,7 +2627,7 @@ unsafe impl<I: TrustedLen> TrustedLen for Take<I> {}
26272627
/// This `struct` is created by the [`scan`] method on [`Iterator`]. See its
26282628
/// documentation for more.
26292629
///
2630-
/// [`scan`]: trait.Iterator.html#method.scan
2630+
/// [`scan`]: Iterator::scan
26312631
/// [`Iterator`]: trait.Iterator.html
26322632
#[must_use = "iterators are lazy and do nothing unless consumed"]
26332633
#[stable(feature = "rust1", since = "1.0.0")]
@@ -2735,7 +2735,7 @@ unsafe impl<St, F, B, I: InPlaceIterable> InPlaceIterable for Scan<I, St, F> whe
27352735
/// This `struct` is created by the [`inspect`] method on [`Iterator`]. See its
27362736
/// documentation for more.
27372737
///
2738-
/// [`inspect`]: trait.Iterator.html#method.inspect
2738+
/// [`inspect`]: Iterator::inspect
27392739
/// [`Iterator`]: trait.Iterator.html
27402740
#[must_use = "iterators are lazy and do nothing unless consumed"]
27412741
#[stable(feature = "rust1", since = "1.0.0")]

library/std/src/collections/hash/map.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1390,8 +1390,6 @@ pub struct IntoValues<K, V> {
13901390
/// A builder for computing where in a HashMap a key-value pair would be stored.
13911391
///
13921392
/// See the [`HashMap::raw_entry_mut`] docs for usage examples.
1393-
///
1394-
/// [`HashMap::raw_entry_mut`]: HashMap::raw_entry_mut
13951393
#[unstable(feature = "hash_raw_entry", issue = "56167")]
13961394
pub struct RawEntryBuilderMut<'a, K: 'a, V: 'a, S: 'a> {
13971395
map: &'a mut HashMap<K, V, S>,
@@ -1430,8 +1428,6 @@ pub struct RawVacantEntryMut<'a, K: 'a, V: 'a, S: 'a> {
14301428
/// A builder for computing where in a HashMap a key-value pair would be stored.
14311429
///
14321430
/// See the [`HashMap::raw_entry`] docs for usage examples.
1433-
///
1434-
/// [`HashMap::raw_entry`]: HashMap::raw_entry
14351431
#[unstable(feature = "hash_raw_entry", issue = "56167")]
14361432
pub struct RawEntryBuilder<'a, K: 'a, V: 'a, S: 'a> {
14371433
map: &'a HashMap<K, V, S>,

library/std/src/sync/mpsc/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,6 @@ unsafe impl<T: Send> Send for SyncSender<T> {}
535535
/// A **send** operation can only fail if the receiving end of a channel is
536536
/// disconnected, implying that the data could never be received. The error
537537
/// contains the data being sent as a payload so it can be recovered.
538-
///
539-
/// [`Sender::send`]: Sender::send
540-
/// [`SyncSender::send`]: SyncSender::send
541538
#[stable(feature = "rust1", since = "1.0.0")]
542539
#[derive(PartialEq, Eq, Clone, Copy)]
543540
pub struct SendError<T>(#[stable(feature = "rust1", since = "1.0.0")] pub T);

0 commit comments

Comments
 (0)