1// run-rustfix
2
3// This test is to check if suggestions can be applied automatically.
4
5#![allow(dead_code, unused_parens)]
6
7fn main() {}
8
9fn test_and() {
10    let a = true;
11    let b = false;
12
13    let _ = a && b; //~ ERROR `and` is not a logical operator
14
15    if a && b { //~ ERROR `and` is not a logical operator
16        println!("both");
17    }
18}
19
20fn test_or() {
21    let a = true;
22    let b = false;
23
24    let _ = a || b; //~ ERROR `or` is not a logical operator
25
26    if a || b { //~ ERROR `or` is not a logical operator
27        println!("both");
28    }
29}
30
31fn test_and_par() {
32    let a = true;
33    let b = false;
34    if (a && b) {  //~ ERROR `and` is not a logical operator
35        println!("both");
36    }
37}
38
39fn test_or_par() {
40    let a = true;
41    let b = false;
42    if (a || b) {  //~ ERROR `or` is not a logical operator
43        println!("both");
44    }
45}
46
47fn test_while_and() {
48    let a = true;
49    let b = false;
50    while a && b {  //~ ERROR `and` is not a logical operator
51        println!("both");
52    }
53}
54
55fn test_while_or() {
56    let a = true;
57    let b = false;
58    while a || b { //~ ERROR `or` is not a logical operator
59        println!("both");
60    }
61}
62