1 // Here we test all the places `|` is *syntactically* allowed.
2 // This is not a semantic test. We only test parsing.
6 #![feature(or_patterns)]
7 #![feature(box_patterns)]
11 // Test the `pat` macro fragment parser:
12 macro_rules! accept_pat {
17 accept_pat!((p | q,));
18 accept_pat!(TS(p | q));
19 accept_pat!(NS { f: p | q });
26 // Top level of `let`:
33 // Top level of `for`:
37 // Top level of `while`:
38 while let | A | B = 0 {}
39 while let A | B = 0 {}
45 // Top level of `match` arms:
55 let _ = |(A | B): u8| ();
57 // Parenthesis and tuple patterns:
61 // Tuple struct patterns:
66 let S { f1: B | C, f2 };
67 let E::V { f1: B | C, f2 };
72 // These bind as `(prefix p) | q` as opposed to `prefix (p | q)`:
73 let box 0 | 1; // Unstable; we *can* the precedence if we want.
78 let ref mut x @ 0 | 1;