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