@@ -35,6 +35,8 @@ macro_rules! panic {
35
35
/// This will invoke the [`panic!`] macro if the provided expression cannot be
36
36
/// evaluated to `true` at runtime.
37
37
///
38
+ /// # Uses
39
+ ///
38
40
/// Assertions are always checked in both debug and release builds, and cannot
39
41
/// be disabled. See [`debug_assert!`] for assertions that are not enabled in
40
42
/// release builds by default.
@@ -45,7 +47,9 @@ macro_rules! panic {
45
47
/// Other use-cases of `assert!` include [testing] and enforcing run-time
46
48
/// invariants in safe code (whose violation cannot result in unsafety).
47
49
///
48
- /// This macro has a second version, where a custom panic message can
50
+ /// # Custom Messages
51
+ ///
52
+ /// This macro has a second form, where a custom panic message can
49
53
/// be provided with or without arguments for formatting.
50
54
///
51
55
/// [`panic!`]: macro.panic.html
@@ -85,14 +89,15 @@ macro_rules! assert {
85
89
) ;
86
90
}
87
91
88
- /// Asserts that two expressions are equal to each other.
92
+ /// Asserts that two expressions are equal to each other (using [`PartialEq`]) .
89
93
///
90
94
/// On panic, this macro will print the values of the expressions with their
91
95
/// debug representations.
92
96
///
93
- /// Like [`assert!`], this macro has a second version , where a custom
97
+ /// Like [`assert!`], this macro has a second form , where a custom
94
98
/// panic message can be provided.
95
99
///
100
+ /// [`PartialEq`]: cmp/trait.PartialEq.html
96
101
/// [`assert!`]: macro.assert.html
97
102
///
98
103
/// # Examples
@@ -130,14 +135,15 @@ macro_rules! assert_eq {
130
135
} ) ;
131
136
}
132
137
133
- /// Asserts that two expressions are not equal to each other.
138
+ /// Asserts that two expressions are not equal to each other (using [`PartialEq`]) .
134
139
///
135
140
/// On panic, this macro will print the values of the expressions with their
136
141
/// debug representations.
137
142
///
138
- /// Like `assert!()` , this macro has a second version , where a custom
143
+ /// Like [ `assert!`] , this macro has a second form , where a custom
139
144
/// panic message can be provided.
140
145
///
146
+ /// [`PartialEq`]: cmp/trait.PartialEq.html
141
147
/// [`assert!`]: macro.assert.html
142
148
///
143
149
/// # Examples
@@ -183,6 +189,8 @@ macro_rules! assert_ne {
183
189
/// Like [`assert!`], this macro also has a second version, where a custom panic
184
190
/// message can be provided.
185
191
///
192
+ /// # Uses
193
+ ///
186
194
/// Unlike [`assert!`], `debug_assert!` statements are only enabled in non
187
195
/// optimized builds by default. An optimized build will omit all
188
196
/// `debug_assert!` statements unless `-C debug-assertions` is passed to the
0 commit comments