You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
2
-
--> tests/ui/absurd-extreme-comparisons.rs:14:5
2
+
--> tests/ui/absurd-extreme-comparisons.rs:16:5
3
3
|
4
4
LL | u <= 0;
5
5
| ^^^^^^
@@ -9,140 +9,156 @@ LL | u <= 0;
9
9
= help: to override `-D warnings` add `#[allow(clippy::absurd_extreme_comparisons)]`
10
10
11
11
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
12
-
--> tests/ui/absurd-extreme-comparisons.rs:17:5
12
+
--> tests/ui/absurd-extreme-comparisons.rs:19:5
13
13
|
14
14
LL | u <= Z;
15
15
| ^^^^^^
16
16
|
17
17
= help: because `Z` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `u == Z` instead
18
18
19
19
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
20
-
--> tests/ui/absurd-extreme-comparisons.rs:20:5
20
+
--> tests/ui/absurd-extreme-comparisons.rs:22:5
21
21
|
22
22
LL | u < Z;
23
23
| ^^^^^
24
24
|
25
25
= help: because `Z` is the minimum value for this type, this comparison is always false
26
26
27
27
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
28
-
--> tests/ui/absurd-extreme-comparisons.rs:23:5
28
+
--> tests/ui/absurd-extreme-comparisons.rs:25:5
29
29
|
30
30
LL | Z >= u;
31
31
| ^^^^^^
32
32
|
33
33
= help: because `Z` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `Z == u` instead
34
34
35
35
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
36
-
--> tests/ui/absurd-extreme-comparisons.rs:26:5
36
+
--> tests/ui/absurd-extreme-comparisons.rs:28:5
37
37
|
38
38
LL | Z > u;
39
39
| ^^^^^
40
40
|
41
41
= help: because `Z` is the minimum value for this type, this comparison is always false
42
42
43
43
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
44
-
--> tests/ui/absurd-extreme-comparisons.rs:29:5
44
+
--> tests/ui/absurd-extreme-comparisons.rs:31:5
45
45
|
46
46
LL | u > u32::MAX;
47
47
| ^^^^^^^^^^^^
48
48
|
49
49
= help: because `u32::MAX` is the maximum value for this type, this comparison is always false
50
50
51
51
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
52
-
--> tests/ui/absurd-extreme-comparisons.rs:32:5
52
+
--> tests/ui/absurd-extreme-comparisons.rs:34:5
53
53
|
54
54
LL | u >= u32::MAX;
55
55
| ^^^^^^^^^^^^^
56
56
|
57
57
= help: because `u32::MAX` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `u == u32::MAX` instead
58
58
59
59
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
60
-
--> tests/ui/absurd-extreme-comparisons.rs:35:5
60
+
--> tests/ui/absurd-extreme-comparisons.rs:37:5
61
61
|
62
62
LL | u32::MAX < u;
63
63
| ^^^^^^^^^^^^
64
64
|
65
65
= help: because `u32::MAX` is the maximum value for this type, this comparison is always false
66
66
67
67
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
68
-
--> tests/ui/absurd-extreme-comparisons.rs:38:5
68
+
--> tests/ui/absurd-extreme-comparisons.rs:40:5
69
69
|
70
70
LL | u32::MAX <= u;
71
71
| ^^^^^^^^^^^^^
72
72
|
73
73
= help: because `u32::MAX` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `u32::MAX == u` instead
74
74
75
75
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
76
-
--> tests/ui/absurd-extreme-comparisons.rs:41:5
76
+
--> tests/ui/absurd-extreme-comparisons.rs:43:5
77
77
|
78
78
LL | 1-1 > u;
79
79
| ^^^^^^^
80
80
|
81
81
= help: because `1-1` is the minimum value for this type, this comparison is always false
82
82
83
83
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
84
-
--> tests/ui/absurd-extreme-comparisons.rs:44:5
84
+
--> tests/ui/absurd-extreme-comparisons.rs:46:5
85
85
|
86
86
LL | u >= !0;
87
87
| ^^^^^^^
88
88
|
89
89
= help: because `!0` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `u == !0` instead
90
90
91
91
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
92
-
--> tests/ui/absurd-extreme-comparisons.rs:47:5
92
+
--> tests/ui/absurd-extreme-comparisons.rs:49:5
93
93
|
94
94
LL | u <= 12 - 2*6;
95
95
| ^^^^^^^^^^^^^
96
96
|
97
97
= help: because `12 - 2*6` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `u == 12 - 2*6` instead
98
98
99
99
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
100
-
--> tests/ui/absurd-extreme-comparisons.rs:51:5
100
+
--> tests/ui/absurd-extreme-comparisons.rs:53:5
101
101
|
102
102
LL | i < -127 - 1;
103
103
| ^^^^^^^^^^^^
104
104
|
105
105
= help: because `-127 - 1` is the minimum value for this type, this comparison is always false
106
106
107
107
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
108
-
--> tests/ui/absurd-extreme-comparisons.rs:54:5
108
+
--> tests/ui/absurd-extreme-comparisons.rs:56:5
109
109
|
110
110
LL | i8::MAX >= i;
111
111
| ^^^^^^^^^^^^
112
112
|
113
113
= help: because `i8::MAX` is the maximum value for this type, this comparison is always true
114
114
115
115
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
116
-
--> tests/ui/absurd-extreme-comparisons.rs:57:5
116
+
--> tests/ui/absurd-extreme-comparisons.rs:59:5
117
117
|
118
118
LL | 3-7 < i32::MIN;
119
119
| ^^^^^^^^^^^^^^
120
120
|
121
121
= help: because `i32::MIN` is the minimum value for this type, this comparison is always false
122
122
123
123
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
124
-
--> tests/ui/absurd-extreme-comparisons.rs:61:5
124
+
--> tests/ui/absurd-extreme-comparisons.rs:63:5
125
125
|
126
126
LL | b >= true;
127
127
| ^^^^^^^^^
128
128
|
129
129
= help: because `true` is the maximum value for this type, the case where the two sides are not equal never occurs, consider using `b == true` instead
130
130
131
131
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
132
-
--> tests/ui/absurd-extreme-comparisons.rs:64:5
132
+
--> tests/ui/absurd-extreme-comparisons.rs:66:5
133
133
|
134
134
LL | false > b;
135
135
| ^^^^^^^^^
136
136
|
137
137
= help: because `false` is the minimum value for this type, this comparison is always false
138
138
139
139
error: <-comparison of unit values detected. This will always be false
140
-
--> tests/ui/absurd-extreme-comparisons.rs:69:5
140
+
--> tests/ui/absurd-extreme-comparisons.rs:71:5
141
141
|
142
142
LL | () < {};
143
143
| ^^^^^^^
144
144
|
145
145
= note: `#[deny(clippy::unit_cmp)]` on by default
146
146
147
-
error: aborting due to 18 previous errors
147
+
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
0 commit comments