about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2019-10-23 15:42:52 +0200
committerSimon Sapin <simon.sapin@exyr.org>2019-10-23 15:46:42 +0200
commite76a1846153209b15dfbf697a33c25214bb753b3 (patch)
treec1c035bf10dca277c35e2096477fcc131a63f969
parentf7ebe193389b4c63d9c93d79fff59568985e1763 (diff)
downloadrust-e76a1846153209b15dfbf697a33c25214bb753b3.tar.gz
rust-e76a1846153209b15dfbf697a33c25214bb753b3.zip
Document guard expressions in `matches!`
-rw-r--r--src/libcore/macros.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index 6e19878ef17..35558e3abcd 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -238,7 +238,10 @@ macro_rules! debug_assert_ne {
     ($($arg:tt)*) => (if $crate::cfg!(debug_assertions) { $crate::assert_ne!($($arg)*); })
 }
 
-/// Returns whether the given expression matches (any of) the given pattern(s).
+/// Returns whether the given expression matches any of the given patterns.
+///
+/// Like in a `match` expression, the pattern can be optionally followed by `if`
+/// and a guard expression that has access to names bound by the pattern.
 ///
 /// # Examples
 ///