Skip to content

Commit b8c3a6c

Browse files
authored
Rollup merge of rust-lang#89010 - est31:intra_doc_links, r=m-ou-se
Add some intra doc links
2 parents f9d4eb0 + 3727119 commit b8c3a6c

File tree

7 files changed

+25
-11
lines changed

7 files changed

+25
-11
lines changed

Diff for: library/alloc/src/collections/binary_heap.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ use super::SpecExtend;
159159
/// This will be a max-heap.
160160
///
161161
/// It is a logic error for an item to be modified in such a way that the
162-
/// item's ordering relative to any other item, as determined by the `Ord`
162+
/// item's ordering relative to any other item, as determined by the [`Ord`]
163163
/// trait, changes while it is in the heap. This is normally only possible
164-
/// through `Cell`, `RefCell`, global state, I/O, or unsafe code. The
164+
/// through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. The
165165
/// behavior resulting from such a logic error is not specified, but will
166166
/// not result in undefined behavior. This could include panics, incorrect
167167
/// results, aborts, memory leaks, and non-termination.
@@ -219,7 +219,7 @@ use super::SpecExtend;
219219
///
220220
/// ## Min-heap
221221
///
222-
/// Either `std::cmp::Reverse` or a custom `Ord` implementation can be used to
222+
/// Either [`core::cmp::Reverse`] or a custom [`Ord`] implementation can be used to
223223
/// make `BinaryHeap` a min-heap. This makes `heap.pop()` return the smallest
224224
/// value instead of the greatest one.
225225
///
@@ -250,6 +250,10 @@ use super::SpecExtend;
250250
/// The value for `push` is an expected cost; the method documentation gives a
251251
/// more detailed analysis.
252252
///
253+
/// [`core::cmp::Reverse`]: core::cmp::Reverse
254+
/// [`Ord`]: core::cmp::Ord
255+
/// [`Cell`]: core::cell::Cell
256+
/// [`RefCell`]: core::cell::RefCell
253257
/// [push]: BinaryHeap::push
254258
/// [pop]: BinaryHeap::pop
255259
/// [peek]: BinaryHeap::peek
@@ -1255,9 +1259,10 @@ impl<T> FusedIterator for Iter<'_, T> {}
12551259
/// An owning iterator over the elements of a `BinaryHeap`.
12561260
///
12571261
/// This `struct` is created by [`BinaryHeap::into_iter()`]
1258-
/// (provided by the `IntoIterator` trait). See its documentation for more.
1262+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
12591263
///
12601264
/// [`into_iter`]: BinaryHeap::into_iter
1265+
/// [`IntoIterator`]: core::iter::IntoIterator
12611266
#[stable(feature = "rust1", since = "1.0.0")]
12621267
#[derive(Clone)]
12631268
pub struct IntoIter<T> {

Diff for: library/alloc/src/collections/btree/map.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,10 @@ impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for IterMut<'_, K, V> {
326326
/// An owning iterator over the entries of a `BTreeMap`.
327327
///
328328
/// This `struct` is created by the [`into_iter`] method on [`BTreeMap`]
329-
/// (provided by the `IntoIterator` trait). See its documentation for more.
329+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
330330
///
331331
/// [`into_iter`]: IntoIterator::into_iter
332+
/// [`IntoIterator`]: core::iter::IntoIterator
332333
#[stable(feature = "rust1", since = "1.0.0")]
333334
pub struct IntoIter<K, V> {
334335
range: LazyLeafRange<marker::Dying, K, V>,

Diff for: library/alloc/src/collections/btree/set.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ impl<T: fmt::Debug> fmt::Debug for Iter<'_, T> {
107107
/// An owning iterator over the items of a `BTreeSet`.
108108
///
109109
/// This `struct` is created by the [`into_iter`] method on [`BTreeSet`]
110-
/// (provided by the `IntoIterator` trait). See its documentation for more.
110+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
111111
///
112112
/// [`into_iter`]: BTreeSet#method.into_iter
113+
/// [`IntoIterator`]: core::iter::IntoIterator
113114
#[stable(feature = "rust1", since = "1.0.0")]
114115
#[derive(Debug)]
115116
pub struct IntoIter<T> {

Diff for: library/alloc/src/collections/linked_list.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ mod tests;
3838
/// let list = LinkedList::from([1, 2, 3]);
3939
/// ```
4040
///
41-
/// NOTE: It is almost always better to use `Vec` or `VecDeque` because
41+
/// NOTE: It is almost always better to use [`Vec`] or [`VecDeque`] because
4242
/// array-based containers are generally faster,
4343
/// more memory efficient, and make better use of CPU cache.
44+
///
45+
/// [`Vec`]: crate::vec::Vec
46+
/// [`VecDeque`]: super::vec_deque::VecDeque
4447
#[stable(feature = "rust1", since = "1.0.0")]
4548
#[cfg_attr(not(test), rustc_diagnostic_item = "LinkedList")]
4649
pub struct LinkedList<T> {
@@ -121,9 +124,10 @@ impl<T: fmt::Debug> fmt::Debug for IterMut<'_, T> {
121124
/// An owning iterator over the elements of a `LinkedList`.
122125
///
123126
/// This `struct` is created by the [`into_iter`] method on [`LinkedList`]
124-
/// (provided by the `IntoIterator` trait). See its documentation for more.
127+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
125128
///
126129
/// [`into_iter`]: LinkedList::into_iter
130+
/// [`IntoIterator`]: core::iter::IntoIterator
127131
#[derive(Clone)]
128132
#[stable(feature = "rust1", since = "1.0.0")]
129133
pub struct IntoIter<T> {

Diff for: library/alloc/src/collections/vec_deque/into_iter.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ use super::VecDeque;
88
/// An owning iterator over the elements of a `VecDeque`.
99
///
1010
/// This `struct` is created by the [`into_iter`] method on [`VecDeque`]
11-
/// (provided by the `IntoIterator` trait). See its documentation for more.
11+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
1212
///
1313
/// [`into_iter`]: VecDeque::into_iter
14+
/// [`IntoIterator`]: core::iter::IntoIterator
1415
#[derive(Clone)]
1516
#[stable(feature = "rust1", since = "1.0.0")]
1617
pub struct IntoIter<

Diff for: library/std/src/collections/hash/map.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1257,9 +1257,10 @@ impl<'a, K, V> IterMut<'a, K, V> {
12571257
/// An owning iterator over the entries of a `HashMap`.
12581258
///
12591259
/// This `struct` is created by the [`into_iter`] method on [`HashMap`]
1260-
/// (provided by the `IntoIterator` trait). See its documentation for more.
1260+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
12611261
///
12621262
/// [`into_iter`]: IntoIterator::into_iter
1263+
/// [`IntoIterator`]: crate::iter::IntoIterator
12631264
///
12641265
/// # Example
12651266
///

Diff for: library/std/src/collections/hash/set.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1237,9 +1237,10 @@ pub struct Iter<'a, K: 'a> {
12371237
/// An owning iterator over the items of a `HashSet`.
12381238
///
12391239
/// This `struct` is created by the [`into_iter`] method on [`HashSet`]
1240-
/// (provided by the `IntoIterator` trait). See its documentation for more.
1240+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
12411241
///
12421242
/// [`into_iter`]: IntoIterator::into_iter
1243+
/// [`IntoIterator`]: crate::iter::IntoIterator
12431244
///
12441245
/// # Examples
12451246
///

0 commit comments

Comments
 (0)