about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2015-10-28 20:27:34 -0400
committerSteve Klabnik <steve@steveklabnik.com>2015-10-28 20:27:34 -0400
commit2f0b4ddfa9e0ba276e179c383c8ae5d11615e42e (patch)
tree1cda77783f85c29d6835682b21c09b1a12df972e
parent3f3b55bd4d909f2a2e7a477236b724379b9b33f2 (diff)
parentad8dcb64bf88bcfbf7bf12c09b6bc7d0e2e3accc (diff)
downloadrust-2f0b4ddfa9e0ba276e179c383c8ae5d11615e42e.tar.gz
rust-2f0b4ddfa9e0ba276e179c383c8ae5d11615e42e.zip
Rollup merge of #29417 - pmarcelll:assert-doc, r=steveklabnik
…m message

I recently discovered that this is not mentioned in the docs, only in
the examples, and it's not evident for people coming from C++

r? @steveklabnik
-rw-r--r--src/libcore/macros.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index bb112327abf..5b5f59d5ddb 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -34,6 +34,8 @@ macro_rules! panic {
 /// This will invoke the `panic!` macro if the provided expression cannot be
 /// evaluated to `true` at runtime.
 ///
+/// This macro has a second version, where a custom panic message can be provided.
+///
 /// # Examples
 ///
 /// ```
@@ -99,6 +101,9 @@ macro_rules! assert_eq {
 /// This will invoke the `panic!` macro if the provided expression cannot be
 /// evaluated to `true` at runtime.
 ///
+/// Like `assert!`, this macro also has a second version, where a custom panic
+/// message can be provided.
+///
 /// Unlike `assert!`, `debug_assert!` statements are only enabled in non
 /// optimized builds by default. An optimized build will omit all
 /// `debug_assert!` statements unless `-C debug-assertions` is passed to the