Skip to content

Commit 65ac1e9

Browse files
Add missing urls in some macros doc
1 parent 11bc48a commit 65ac1e9

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/libcore/macros.rs

+16-7
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ macro_rules! panic {
3232

3333
/// Ensure that a boolean expression is `true` at runtime.
3434
///
35-
/// This will invoke the `panic!` macro if the provided expression cannot be
35+
/// This will invoke the [`panic!`] macro if the provided expression cannot be
3636
/// evaluated to `true` at runtime.
3737
///
3838
/// Assertions are always checked in both debug and release builds, and cannot
39-
/// be disabled. See `debug_assert!` for assertions that are not enabled in
39+
/// be disabled. See [`debug_assert!`] for assertions that are not enabled in
4040
/// release builds by default.
4141
///
4242
/// Unsafe code relies on `assert!` to enforce run-time invariants that, if
@@ -48,6 +48,8 @@ macro_rules! panic {
4848
/// This macro has a second version, where a custom panic message can
4949
/// be provided with or without arguments for formatting.
5050
///
51+
/// [`panic!`]: macro.panic.html
52+
/// [`debug_assert!`]: macro.debug_assert.html
5153
/// [testing]: ../book/testing.html
5254
///
5355
/// # Examples
@@ -88,9 +90,11 @@ macro_rules! assert {
8890
/// On panic, this macro will print the values of the expressions with their
8991
/// debug representations.
9092
///
91-
/// Like `assert!()`, this macro has a second version, where a custom
93+
/// Like [`assert!()`], this macro has a second version, where a custom
9294
/// panic message can be provided.
9395
///
96+
/// [`assert!()`]: macro.assert.html
97+
///
9498
/// # Examples
9599
///
96100
/// ```
@@ -134,6 +138,8 @@ macro_rules! assert_eq {
134138
/// Like `assert!()`, this macro has a second version, where a custom
135139
/// panic message can be provided.
136140
///
141+
/// [`assert!`]: macro.assert.html
142+
///
137143
/// # Examples
138144
///
139145
/// ```
@@ -171,13 +177,13 @@ macro_rules! assert_ne {
171177

172178
/// Ensure that a boolean expression is `true` at runtime.
173179
///
174-
/// This will invoke the `panic!` macro if the provided expression cannot be
180+
/// This will invoke the [`panic!`] macro if the provided expression cannot be
175181
/// evaluated to `true` at runtime.
176182
///
177-
/// Like `assert!`, this macro also has a second version, where a custom panic
183+
/// Like [`assert!`], this macro also has a second version, where a custom panic
178184
/// message can be provided.
179185
///
180-
/// Unlike `assert!`, `debug_assert!` statements are only enabled in non
186+
/// Unlike [`assert!`], `debug_assert!` statements are only enabled in non
181187
/// optimized builds by default. An optimized build will omit all
182188
/// `debug_assert!` statements unless `-C debug-assertions` is passed to the
183189
/// compiler. This makes `debug_assert!` useful for checks that are too
@@ -187,10 +193,13 @@ macro_rules! assert_ne {
187193
/// An unchecked assertion allows a program in an inconsistent state to keep
188194
/// running, which might have unexpected consequences but does not introduce
189195
/// unsafety as long as this only happens in safe code. The performance cost
190-
/// of assertions, is however, not measurable in general. Replacing `assert!`
196+
/// of assertions, is however, not measurable in general. Replacing [`assert!`]
191197
/// with `debug_assert!` is thus only encouraged after thorough profiling, and
192198
/// more importantly, only in safe code!
193199
///
200+
/// [`panic!`]: macro.panic.html
201+
/// [`assert!`]: macro.assert.html
202+
///
194203
/// # Examples
195204
///
196205
/// ```

0 commit comments

Comments
 (0)