-
Notifications
You must be signed in to change notification settings - Fork 32
/
issue-54109-and_instead_of_ampersands.rs
63 lines (51 loc) · 1.22 KB
/
issue-54109-and_instead_of_ampersands.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
fn main() {}
fn test_and() {
let a = true;
let b = false;
let _ = a and b; //~ ERROR `and` is not a logical operator
if a and b { //~ ERROR `and` is not a logical operator
println!("both");
}
let _recovery_witness: () = 0; //~ ERROR mismatched types
}
fn test_or() {
let a = true;
let b = false;
let _ = a or b; //~ ERROR `or` is not a logical operator
if a or b { //~ ERROR `or` is not a logical operator
println!("both");
}
}
fn test_and_par() {
let a = true;
let b = false;
if (a and b) { //~ ERROR `and` is not a logical operator
println!("both");
}
}
fn test_or_par() {
let a = true;
let b = false;
if (a or b) { //~ ERROR `or` is not a logical operator
println!("both");
}
}
fn test_while_and() {
let a = true;
let b = false;
while a and b { //~ ERROR `and` is not a logical operator
println!("both");
}
}
fn test_while_or() {
let a = true;
let b = false;
while a or b { //~ ERROR `or` is not a logical operator
println!("both");
}
}
// ferrocene-annotations: fls_lstusiu2c8lu
// Lazy Boolean Expressions
//
// ferrocene-annotations: fls_izdv9i4spokw
// Operator Expressions