about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/needless_bool_assign.stderr
blob: 1d09b8b25a0919862d87f8e773bc0292327a9b23 (plain)
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
66
error: this if-then-else expression assigns a bool literal
  --> tests/ui/needless_bool_assign.rs:13:5
   |
LL | /     if random() && random() {
LL | |         a.field = true;
LL | |     } else {
LL | |         a.field = false
LL | |     }
   | |_____^ help: you can reduce it to: `a.field = random() && random();`
   |
   = note: `-D clippy::needless-bool-assign` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_bool_assign)]`

error: this if-then-else expression assigns a bool literal
  --> tests/ui/needless_bool_assign.rs:19:5
   |
LL | /     if random() && random() {
LL | |         a.field = false;
LL | |     } else {
LL | |         a.field = true
LL | |     }
   | |_____^ help: you can reduce it to: `a.field = !(random() && random());`

error: this if-then-else expression assigns a bool literal
  --> tests/ui/needless_bool_assign.rs:34:5
   |
LL | /     if random() {
LL | |         a.field = true;
LL | |     } else {
LL | |         a.field = true;
LL | |     }
   | |_____^ help: you can reduce it to: `random(); a.field = true;`

error: this `if` has identical blocks
  --> tests/ui/needless_bool_assign.rs:34:17
   |
LL |       if random() {
   |  _________________^
LL | |         a.field = true;
LL | |     } else {
   | |_____^
   |
note: same as this
  --> tests/ui/needless_bool_assign.rs:36:12
   |
LL |       } else {
   |  ____________^
LL | |         a.field = true;
LL | |     }
   | |_____^
   = note: `-D clippy::if-same-then-else` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::if_same_then_else)]`

error: this if-then-else expression assigns a bool literal
  --> tests/ui/needless_bool_assign.rs:54:12
   |
LL |       } else if x || y {
   |  ____________^
LL | |         z = true;
LL | |     } else {
LL | |         z = false;
LL | |     }
   | |_____^ help: you can reduce it to: `{ z = x || y; }`

error: aborting due to 5 previous errors