about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-07-28 18:42:13 +0200
committerChristian Duerr <contact@christianduerr.com>2020-07-28 18:42:13 +0200
commitf3d7645fb79d641de447d4af02d5f3cee91b4af3 (patch)
tree5d952d3cb92d1464134fb597f6c8c61a6762aaa6
parent2c28244cf0fc9868f55070e55b8f332d196eaf3f (diff)
downloadrust-f3d7645fb79d641de447d4af02d5f3cee91b4af3.tar.gz
rust-f3d7645fb79d641de447d4af02d5f3cee91b4af3.zip
Add trailing comma support to matches macro
-rw-r--r--library/core/src/macros/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs
index 3b9057b7e83..c92ca22509a 100644
--- a/library/core/src/macros/mod.rs
+++ b/library/core/src/macros/mod.rs
@@ -255,7 +255,7 @@ macro_rules! debug_assert_ne {
 #[macro_export]
 #[stable(feature = "matches_macro", since = "1.42.0")]
 macro_rules! matches {
-    ($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )?) => {
+    ($expression:expr, $( $pattern:pat )|+ $( if $guard: expr )? $(,)?) => {
         match $expression {
             $( $pattern )|+ $( if $guard )? => true,
             _ => false