1 // Here we test all the places `|` is *syntactically* allowed.
2 // This is not a semantic test. We only test parsing.
8 // Test the `pat` macro fragment parser:
9 macro_rules! accept_pat {
14 accept_pat!((p | q,));
15 accept_pat!(TS(p | q));
16 accept_pat!(NS { f: p | q });
23 // Top level of `let`:
30 // Top level of `for`:
34 // Top level of `while`:
35 while let | A | B = 0 {}
36 while let A | B = 0 {}
42 // Top level of `match` arms:
52 let _ = |(A | B): u8| ();
54 // Parenthesis and tuple patterns:
58 // Tuple struct patterns:
63 let S { f1: B | C, f2 };
64 let E::V { f1: B | C, f2 };
69 // These bind as `(prefix p) | q` as opposed to `prefix (p | q)`:
70 let (box 0 | 1); // Unstable; we *can* change the precedence if we want.
75 let (ref mut x @ 0 | 1);