Skip to content

Commit 77b003d

Browse files
Rollup merge of rust-lang#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 rust-lang#46238
2 parents 69581f8 + cdbfd3e commit 77b003d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/ui/macros/macro-comma-support-rpass.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ fn line() {
192192
let _ = line!();
193193
}
194194

195+
#[test]
196+
fn matches() {
197+
let _ = matches!(1, x if x > 0);
198+
let _ = matches!(1, x if x > 0,);
199+
}
200+
195201
#[test]
196202
fn module_path() {
197203
let _ = module_path!();

0 commit comments

Comments
 (0)