Skip to content

Commit 8be8343

Browse files
committed
Add links from assert_eq! docs to debug_assert_eq!, etc.
This adds information and links from the docs for the following macros to their debug-only versions: * `assert_eq!` * `assert_ne!` * `assert_matches!` This matches the existing documentation for the `assert!` macro.
1 parent 2d5a628 commit 8be8343

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

library/core/src/macros/mod.rs

+12
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ macro_rules! panic {
1414

1515
/// Asserts that two expressions are equal to each other (using [`PartialEq`]).
1616
///
17+
/// Assertions are always checked in both debug and release builds, and cannot
18+
/// be disabled. See [`debug_assert_eq!`] for assertions that are disabled in
19+
/// release builds by default.
20+
///
1721
/// On panic, this macro will print the values of the expressions with their
1822
/// debug representations.
1923
///
@@ -64,6 +68,10 @@ macro_rules! assert_eq {
6468

6569
/// Asserts that two expressions are not equal to each other (using [`PartialEq`]).
6670
///
71+
/// Assertions are always checked in both debug and release builds, and cannot
72+
/// be disabled. See [`debug_assert_ne!`] for assertions that are disabled in
73+
/// release builds by default.
74+
///
6775
/// On panic, this macro will print the values of the expressions with their
6876
/// debug representations.
6977
///
@@ -122,6 +130,10 @@ macro_rules! assert_ne {
122130
/// optional if guard can be used to add additional checks that must be true for the matched value,
123131
/// otherwise this macro will panic.
124132
///
133+
/// Assertions are always checked in both debug and release builds, and cannot
134+
/// be disabled. See [`debug_assert_matches!`] for assertions that are disabled in
135+
/// release builds by default.
136+
///
125137
/// On panic, this macro will print the value of the expression with its debug representation.
126138
///
127139
/// Like [`assert!`], this macro has a second form, where a custom panic message can be provided.

0 commit comments

Comments
 (0)