summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/needless_if.stderr
blob: c3e83c0f1f593f9e10d5d6e0d1dd1c95de40fd70 (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
  --> $DIR/needless_if.rs:26: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
  --> $DIR/needless_if.rs:28:5
   |
LL |     if maybe_side_effect() {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `maybe_side_effect();`

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

error: this `if` branch is empty
  --> $DIR/needless_if.rs:49: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
  --> $DIR/needless_if.rs:93:5
   |
LL |     if { maybe_side_effect() } {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() });`

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

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

error: aborting due to 7 previous errors