]> git.proxmox.com Git - rustc.git/blame - src/test/ui/or-patterns/multiple-pattern-typo.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / or-patterns / multiple-pattern-typo.rs
CommitLineData
e1599b0c 1#![feature(or_patterns)]
e1599b0c
XL
2
3fn main() {
4 let x = 3;
5
6 match x {
6a06907d 7 1 | 2 || 3 => (), //~ ERROR unexpected token `||` in pattern
e1599b0c
XL
8 _ => (),
9 }
10
11 match x {
6a06907d 12 (1 | 2 || 3) => (), //~ ERROR unexpected token `||` in pattern
e1599b0c
XL
13 _ => (),
14 }
15
16 match (x,) {
6a06907d 17 (1 | 2 || 3,) => (), //~ ERROR unexpected token `||` in pattern
e1599b0c
XL
18 _ => (),
19 }
20
21 struct TS(u8);
22
23 match TS(x) {
6a06907d 24 TS(1 | 2 || 3) => (), //~ ERROR unexpected token `||` in pattern
e1599b0c
XL
25 _ => (),
26 }
27
28 struct NS { f: u8 }
29
30 match (NS { f: x }) {
6a06907d 31 NS { f: 1 | 2 || 3 } => (), //~ ERROR unexpected token `||` in pattern
e1599b0c
XL
32 _ => (),
33 }
34
35 match [x] {
6a06907d 36 [1 | 2 || 3] => (), //~ ERROR unexpected token `||` in pattern
e1599b0c
XL
37 _ => (),
38 }
39
40 match x {
6a06907d 41 || 1 | 2 | 3 => (), //~ ERROR unexpected token `||` in pattern
e1599b0c
XL
42 _ => (),
43 }
44}