]> git.lizzy.rs Git - rust.git/blob - src/test/ui/or-patterns/issue-64879-trailing-before-guard.rs
Auto merge of #82864 - jyn514:short-circuit, r=GuillaumeGomez
[rust.git] / src / test / ui / or-patterns / issue-64879-trailing-before-guard.rs
1 // In this regression test we check that a trailing `|` in an or-pattern just
2 // before the `if` token of a `match` guard will receive parser recovery with
3 // an appropriate error message.
4
5 enum E { A, B }
6
7 fn main() {
8     match E::A {
9         E::A |
10         E::B | //~ ERROR a trailing `|` is not allowed in an or-pattern
11         if true => {
12             let recovery_witness: bool = 0; //~ ERROR mismatched types
13         }
14     }
15 }