1 // This tests the parser recovery in `recover_intersection_pat`
2 // and serves as a regression test for the diagnostics issue #65400.
4 // The general idea is that for `$pat_lhs @ $pat_rhs` where
5 // `$pat_lhs` is not generated by `ref? mut? $ident` we want
6 // to suggest either switching the order or note that intersection
7 // patterns are not allowed.
11 #![allow(unused_variables)]
14 let s: Option<u8> = None;
18 //~^ ERROR pattern on wrong side of `@`
19 //~| pattern on the left, should be on the right
20 //~| binding on the right, should be on the left
21 //~| HELP switch the order
22 //~| SUGGESTION y @ Some(x)
28 //~^ ERROR pattern on wrong side of `@`
29 //~| pattern on the left, should be on the right
30 //~| binding on the right, should be on the left
31 //~| HELP switch the order
32 //~| SUGGESTION e @ 1..=5