blob: f3e0b1490a6190933a3a583873daffa779371cf3 [file]
//@ run-rustfix
// Replace every top-level comma with `|`, preserving commas inside tuple patterns.
fn matches_pair(pair: (u8, u8)) -> bool {
match pair {
(0, 1), (2, 3), (4, 5) => true,
//~^ ERROR unexpected `,` in pattern
_ => false,
}
}
fn main() {
assert!(matches_pair((0, 1)));
assert!(!matches_pair((0, 5)));
}