1
Fork 0
rust/tests/ui/parser/issues/issue-72373.rs
Nadrieril 962c0140c7 parse guard patterns
Co-authored-by: Max Niederman <max@maxniederman.com>
2024-11-24 19:42:33 +01:00

9 lines
266 B
Rust

fn foo(c: &[u32], n: u32) -> u32 {
match *c {
[h, ..] if h > n => 0,
[h, ..] if h == n => 1,
[h, ref ts..] => foo(c, n - h) + foo(ts, n),
//~^ ERROR expected one of `,`, `@`, `]`, `if`, or `|`, found `..`
[] => 0,
}
}