-
Notifications
You must be signed in to change notification settings - Fork 32
/
else-no-if.rs
65 lines (54 loc) · 941 Bytes
/
else-no-if.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
macro_rules! falsy {
() => { false };
}
fn foo() {
if true {
} else false {
//~^ ERROR expected `{`, found keyword `false`
}
}
fn foo2() {
if true {
} else falsy() {
//~^ ERROR expected `{`, found `falsy`
}
}
fn foo3() {
if true {
} else falsy();
//~^ ERROR expected `{`, found `falsy`
}
fn foo4() {
if true {
} else loop{}
//~^ ERROR expected `{`, found keyword `loop`
{}
}
fn foo5() {
if true {
} else falsy!() {
//~^ ERROR expected `{`, found `falsy`
}
}
fn foo6() {
if true {
} else falsy!();
//~^ ERROR expected `{`, found `falsy`
}
fn foo7() {
if true {
} else falsy! {} {
//~^ ERROR expected `{`, found `falsy`
}
}
fn foo8() {
if true {
} else falsy! {};
//~^ ERROR expected `{`, found `falsy`
}
fn falsy() -> bool {
false
}
fn main() {}
// ferrocene-annotations: fls_mkut7gut49gi
// If Expressions