@@ -32,11 +32,11 @@ macro_rules! panic {
32
32
33
33
/// Ensure that a boolean expression is `true` at runtime.
34
34
///
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
36
36
/// evaluated to `true` at runtime.
37
37
///
38
38
/// 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
40
40
/// release builds by default.
41
41
///
42
42
/// Unsafe code relies on `assert!` to enforce run-time invariants that, if
@@ -48,6 +48,8 @@ macro_rules! panic {
48
48
/// This macro has a second version, where a custom panic message can
49
49
/// be provided with or without arguments for formatting.
50
50
///
51
+ /// [`panic!`]: macro.panic.html
52
+ /// [`debug_assert!`]: macro.debug_assert.html
51
53
/// [testing]: ../book/testing.html
52
54
///
53
55
/// # Examples
@@ -88,9 +90,11 @@ macro_rules! assert {
88
90
/// On panic, this macro will print the values of the expressions with their
89
91
/// debug representations.
90
92
///
91
- /// Like `assert!()`, this macro has a second version, where a custom
93
+ /// Like [ `assert!()`] , this macro has a second version, where a custom
92
94
/// panic message can be provided.
93
95
///
96
+ /// [`assert!()`]: macro.assert.html
97
+ ///
94
98
/// # Examples
95
99
///
96
100
/// ```
@@ -134,6 +138,8 @@ macro_rules! assert_eq {
134
138
/// Like `assert!()`, this macro has a second version, where a custom
135
139
/// panic message can be provided.
136
140
///
141
+ /// [`assert!`]: macro.assert.html
142
+ ///
137
143
/// # Examples
138
144
///
139
145
/// ```
@@ -171,13 +177,13 @@ macro_rules! assert_ne {
171
177
172
178
/// Ensure that a boolean expression is `true` at runtime.
173
179
///
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
175
181
/// evaluated to `true` at runtime.
176
182
///
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
178
184
/// message can be provided.
179
185
///
180
- /// Unlike `assert!`, `debug_assert!` statements are only enabled in non
186
+ /// Unlike [ `assert!`] , `debug_assert!` statements are only enabled in non
181
187
/// optimized builds by default. An optimized build will omit all
182
188
/// `debug_assert!` statements unless `-C debug-assertions` is passed to the
183
189
/// compiler. This makes `debug_assert!` useful for checks that are too
@@ -187,10 +193,13 @@ macro_rules! assert_ne {
187
193
/// An unchecked assertion allows a program in an inconsistent state to keep
188
194
/// running, which might have unexpected consequences but does not introduce
189
195
/// 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!`]
191
197
/// with `debug_assert!` is thus only encouraged after thorough profiling, and
192
198
/// more importantly, only in safe code!
193
199
///
200
+ /// [`panic!`]: macro.panic.html
201
+ /// [`assert!`]: macro.assert.html
202
+ ///
194
203
/// # Examples
195
204
///
196
205
/// ```
0 commit comments