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.
10 let s: Option<u8> = None;
13 Some(x) @ Some(y) => {}
14 //~^ ERROR left-hand side of `@` must be a binding
15 //~| interpreted as a pattern, not a binding
17 //~| NOTE bindings are `x`, `mut x`, `ref x`, and `ref mut x`