blob: b76da3fb1cb58891642896387c9fc459924e2f83 (
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
error: this `if` has identical blocks
--> tests/ui/if_same_then_else.rs:23:13
|
LL | if true {
| _____________^
LL | | Foo { bar: 42 };
LL | | 0..10;
LL | | ..;
... |
LL | | foo();
LL | | } else {
| |_____^
|
note: same as this
--> tests/ui/if_same_then_else.rs:31:12
|
LL | } else {
| ____________^
LL | | Foo { bar: 42 };
LL | | 0..10;
LL | | ..;
... |
LL | | foo();
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` has identical blocks
--> tests/ui/if_same_then_else.rs:67:21
|
LL | let _ = if true { 0.0 } else { 0.0 };
| ^^^^^^^
|
note: same as this
--> tests/ui/if_same_then_else.rs:67:34
|
LL | let _ = if true { 0.0 } else { 0.0 };
| ^^^^^^^
error: this `if` has identical blocks
--> tests/ui/if_same_then_else.rs:70:21
|
LL | let _ = if true { -0.0 } else { -0.0 };
| ^^^^^^^^
|
note: same as this
--> tests/ui/if_same_then_else.rs:70:35
|
LL | let _ = if true { -0.0 } else { -0.0 };
| ^^^^^^^^
error: this `if` has identical blocks
--> tests/ui/if_same_then_else.rs:82:21
|
LL | let _ = if true { 42 } else { 42 };
| ^^^^^^
|
note: same as this
--> tests/ui/if_same_then_else.rs:82:33
|
LL | let _ = if true { 42 } else { 42 };
| ^^^^^^
error: this `if` has identical blocks
--> tests/ui/if_same_then_else.rs:85:13
|
LL | if true {
| _____________^
LL | | let bar = if true { 42 } else { 43 };
LL | |
LL | | while foo() {
... |
LL | | bar + 1;
LL | | } else {
| |_____^
|
note: same as this
--> tests/ui/if_same_then_else.rs:92:12
|
LL | } else {
| ____________^
LL | | let bar = if true { 42 } else { 43 };
LL | |
LL | | while foo() {
... |
LL | | bar + 1;
LL | | }
| |_____^
error: this `if` has identical blocks
--> tests/ui/if_same_then_else.rs:238:14
|
LL | if x {
| ______________^
LL | | 0_u8.is_power_of_two()
LL | | } else {
| |_________^
|
note: same as this
--> tests/ui/if_same_then_else.rs:240:16
|
LL | } else {
| ________________^
LL | | 0_u8.is_power_of_two()
LL | | }
| |_________^
error: aborting due to 6 previous errors
|