about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-05-13 05:33:11 +0200
committerGitHub <noreply@github.com>2022-05-13 05:33:11 +0200
commit7debc95bab21b738b1e0283df9fdb14a48fb2d8a (patch)
tree7c5a02f0e28c190a23defbf364da8f419e58b583
parentf38b7ff3b690a0720506250f421c5983d4f4f9ef (diff)
parentcdbfd3e01136948e2ca7947c6eb37914b296cb2d (diff)
downloadrust-7debc95bab21b738b1e0283df9fdb14a48fb2d8a.tar.gz
rust-7debc95bab21b738b1e0283df9fdb14a48fb2d8a.zip
Rollup merge of #96948 - ludfo774:macro-trailing-comma-test, r=joshtriplett
Add test of matches macro for trailing commas

Almost all macros are tested for trailing commas.
The macro matches! was however not tested.
This PR adds that test case.
Related to #46238
-rw-r--r--src/test/ui/macros/macro-comma-support-rpass.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/ui/macros/macro-comma-support-rpass.rs b/src/test/ui/macros/macro-comma-support-rpass.rs
index f6c4f896d67..25b8c3cc62e 100644
--- a/src/test/ui/macros/macro-comma-support-rpass.rs
+++ b/src/test/ui/macros/macro-comma-support-rpass.rs
@@ -193,6 +193,12 @@ fn line() {
 }
 
 #[test]
+fn matches() {
+    let _ = matches!(1, x if x > 0);
+    let _ = matches!(1, x if x > 0,);
+}
+
+#[test]
 fn module_path() {
     let _ = module_path!();
 }