summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/needless_if.stderr
blob: 9beae596ee39d7539a238f70d7879842d2e74276 (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
67
68
69
70
71
72
73
74
75
error: this `if` branch is empty
  --> tests/ui/needless_if.rs:27:5
   |
LL |     if (true) {}
   |     ^^^^^^^^^^^^ help: you can remove it
   |
   = note: `-D clippy::needless-if` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_if)]`

error: this `if` branch is empty
  --> tests/ui/needless_if.rs:29:5
   |
LL |     if maybe_side_effect() {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `maybe_side_effect();`

error: this `if` branch is empty
  --> tests/ui/needless_if.rs:34:5
   |
LL | /     if {
LL | |         return;
LL | |     } {}
   | |________^
   |
help: you can remove it
   |
LL ~     ({
LL +         return;
LL +     });
   |

error: this `if` branch is empty
  --> tests/ui/needless_if.rs:50:5
   |
LL | /     if {
LL | |         if let true = true
LL | |             && true
LL | |         {
...  |
LL | |     } && true
LL | |     {}
   | |______^
   |
help: you can remove it
   |
LL ~     ({
LL +         if let true = true
LL +             && true
LL +         {
LL +             true
LL +         } else {
LL +             false
LL +         }
LL +     } && true);
   |

error: this `if` branch is empty
  --> tests/ui/needless_if.rs:94:5
   |
LL |     if { maybe_side_effect() } {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() });`

error: this `if` branch is empty
  --> tests/ui/needless_if.rs:96:5
   |
LL |     if { maybe_side_effect() } && true {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() } && true);`

error: this `if` branch is empty
  --> tests/ui/needless_if.rs:100:5
   |
LL |     if true {}
   |     ^^^^^^^^^^ help: you can remove it: `true;`

error: aborting due to 7 previous errors