Skip to content

Commit 0149b9f

Browse files
committed
Automatic Item linkification part 1
1 parent 7189ae3 commit 0149b9f

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

src/libcollections/btree/map.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ use self::Entry::*;
5656
/// however, performance is excellent.
5757
///
5858
/// It is a logic error for a key to be modified in such a way that the key's ordering relative to
59-
/// any other key, as determined by the `Ord` trait, changes while it is in the map. This is
60-
/// normally only possible through `Cell`, `RefCell`, global state, I/O, or unsafe code.
59+
/// any other key, as determined by the [`Ord`] trait, changes while it is in the map. This is
60+
/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code.
6161
///
6262
/// # Examples
6363
///
6464
/// ```
6565
/// use std::collections::BTreeMap;
6666
///
6767
/// // type inference lets us omit an explicit type signature (which
68-
/// // would be `BTreeMap<&str, &str>` in this example).
68+
/// // would be [`BTreeMap<&str, &str>`] in this example).
6969
/// let mut movie_reviews = BTreeMap::new();
7070
///
7171
/// // review some movies.
@@ -98,15 +98,15 @@ use self::Entry::*;
9898
/// }
9999
/// ```
100100
///
101-
/// `BTreeMap` also implements an [`Entry API`](#method.entry), which allows
101+
/// [`BTreeMap`] also implements an [`Entry API`](#method.entry), which allows
102102
/// for more complex methods of getting, setting, updating and removing keys and
103103
/// their values:
104104
///
105105
/// ```
106106
/// use std::collections::BTreeMap;
107107
///
108108
/// // type inference lets us omit an explicit type signature (which
109-
/// // would be `BTreeMap<&str, u8>` in this example).
109+
/// // would be [`BTreeMap<&str, u8>`] in this example).
110110
/// let mut player_stats = BTreeMap::new();
111111
///
112112
/// fn random_stat_buff() -> u8 {
@@ -126,6 +126,13 @@ use self::Entry::*;
126126
/// let stat = player_stats.entry("attack").or_insert(100);
127127
/// *stat += random_stat_buff();
128128
/// ```
129+
///
130+
/// [`BTreeMap`]: /std/collections/struct.BTreeMap.html
131+
/// [`BTreeMap<&str, &str>`]: /std/collections/struct.BTreeMap.html
132+
/// [`BTreeMap<&str, u8>`]: /std/collections/struct.BTreeMap.html
133+
/// [`Cell`]: /std/cell/struct.Cell.html
134+
/// [`Ord`]: /std/cmp/trait.Ord.html
135+
/// [`RefCell`]: /std/cell/struct.RefCell.html
129136
#[stable(feature = "rust1", since = "1.0.0")]
130137
pub struct BTreeMap<K, V> {
131138
root: node::Root<K, V>,

src/libstd/macros.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/// The entry point for panic of Rust threads.
1818
///
1919
/// This macro is used to inject panic into a Rust thread, causing the thread to
20-
/// panic entirely. Each thread's panic can be reaped as the `Box<Any>` type,
20+
/// panic entirely. Each thread's panic can be reaped as the [`Box<Any>`] type,
2121
/// and the single-argument form of the `panic!` macro will be the value which
2222
/// is transmitted.
2323
///
@@ -33,6 +33,8 @@
3333
/// panic!(4); // panic with the value of 4 to be collected elsewhere
3434
/// panic!("this is a {} {message}", "fancy", message = "message");
3535
/// ```
36+
///
37+
/// [`Box<Any>`]: ../../collections/boxed/struct.Box.html
3638
#[macro_export]
3739
#[stable(feature = "rust1", since = "1.0.0")]
3840
#[allow_internal_unstable]
@@ -61,7 +63,7 @@ macro_rules! panic {
6163

6264
/// Macro for printing to the standard output.
6365
///
64-
/// Equivalent to the `println!` macro except that a newline is not printed at
66+
/// Equivalent to the [`println!`] macro except that a newline is not printed at
6567
/// the end of the message.
6668
///
6769
/// Note that stdout is frequently line-buffered by default so it may be
@@ -91,6 +93,8 @@ macro_rules! panic {
9193
///
9294
/// io::stdout().flush().unwrap();
9395
/// ```
96+
///
97+
/// [`println!`]: ../../std/macro.println!.html
9498
#[macro_export]
9599
#[stable(feature = "rust1", since = "1.0.0")]
96100
#[allow_internal_unstable]
@@ -101,7 +105,7 @@ macro_rules! print {
101105
/// Macro for printing to the standard output, with a newline.
102106
///
103107
/// Use the `format!` syntax to write data to the standard output.
104-
/// See `std::fmt` for more information.
108+
/// See [`std::fmt`] for more information.
105109
///
106110
/// # Panics
107111
///
@@ -113,6 +117,8 @@ macro_rules! print {
113117
/// println!("hello there!");
114118
/// println!("format {} arguments", "some");
115119
/// ```
120+
///
121+
/// [`std::fmt`]: ../../std/fmt/index.html
116122
#[macro_export]
117123
#[stable(feature = "rust1", since = "1.0.0")]
118124
macro_rules! println {
@@ -154,7 +160,9 @@ macro_rules! println {
154160
/// # drop(rx2.recv());
155161
/// ```
156162
///
157-
/// For more information about select, see the `std::sync::mpsc::Select` structure.
163+
/// For more information about select, see the [`std::sync::mpsc::Select`] structure.
164+
///
165+
/// [`std::sync::mpsc::Select`]: ../../std/sync/mpsc/struct.Select.html
158166
#[macro_export]
159167
#[unstable(feature = "mpsc_select", issue = "27800")]
160168
macro_rules! select {

0 commit comments

Comments
 (0)