mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 11:34:11 +00:00
f10da9f50a
This is allowed in `match` statement, and stated in https://internals.rust-lang.org/t/leading-pipe-in-core-matches/14699/2 that it should be allowed in these macros too.
21 lines
297 B
Rust
21 lines
297 B
Rust
#[test]
|
|
fn assert_eq_trailing_comma() {
|
|
assert_eq!(1, 1,);
|
|
}
|
|
|
|
#[test]
|
|
fn assert_escape() {
|
|
assert!(r#"☃\backslash"#.contains("\\"));
|
|
}
|
|
|
|
#[test]
|
|
fn assert_ne_trailing_comma() {
|
|
assert_ne!(1, 2,);
|
|
}
|
|
|
|
#[rustfmt::skip]
|
|
#[test]
|
|
fn matches_leading_pipe() {
|
|
matches!(1, | 1 | 2 | 3);
|
|
}
|