1 // gate-test-if_let_guard
8 //~^ ERROR `if let` guards are experimental
10 () if (let 0 = 1) => {}
11 //~^ ERROR `let` expressions in this position are unstable
12 //~| ERROR expected expression, found `let` statement
14 () if (((let 0 = 1))) => {}
15 //~^ ERROR `let` expressions in this position are unstable
16 //~| ERROR expected expression, found `let` statement
18 () if true && let 0 = 1 => {}
19 //~^ ERROR `if let` guards are experimental
20 //~| ERROR `let` expressions in this position are unstable
22 () if let 0 = 1 && true => {}
23 //~^ ERROR `if let` guards are experimental
24 //~| ERROR `let` expressions in this position are unstable
26 () if (let 0 = 1) && true => {}
27 //~^ ERROR `let` expressions in this position are unstable
28 //~| ERROR expected expression, found `let` statement
30 () if true && (let 0 = 1) => {}
31 //~^ ERROR `let` expressions in this position are unstable
32 //~| ERROR expected expression, found `let` statement
34 () if (let 0 = 1) && (let 0 = 1) => {}
35 //~^ ERROR `let` expressions in this position are unstable
36 //~| ERROR `let` expressions in this position are unstable
37 //~| ERROR expected expression, found `let` statement
38 //~| ERROR expected expression, found `let` statement
40 () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
41 //~^ ERROR `if let` guards are experimental
42 //~| ERROR `let` expressions in this position are unstable
43 //~| ERROR `let` expressions in this position are unstable
44 //~| ERROR `let` expressions in this position are unstable
45 //~| ERROR `let` expressions in this position are unstable
46 //~| ERROR `let` expressions in this position are unstable
47 //~| ERROR expected expression, found `let` statement
48 //~| ERROR expected expression, found `let` statement
49 //~| ERROR expected expression, found `let` statement
51 () if let Range { start: _, end: _ } = (true..true) && false => {}
52 //~^ ERROR `if let` guards are experimental
53 //~| ERROR `let` expressions in this position are unstable
60 macro_rules! use_expr {
68 use_expr!((let 0 = 1 && 0 == 0));
69 //~^ ERROR `let` expressions in this position are unstable
70 //~| ERROR expected expression, found `let` statement
71 use_expr!((let 0 = 1));
72 //~^ ERROR `let` expressions in this position are unstable
73 //~| ERROR expected expression, found `let` statement
77 //~^ ERROR `if let` guards are experimental
81 //~^ ERROR no rules expected the token `let`