1
1
error: `(-6_i32)` is never greater than `9` and has therefore no effect
2
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:5 :13
2
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:13 :13
3
3
|
4
4
LL | let _ = (-6_i32).min(9);
5
5
| ^^^^^^^^^^^^^^^ help: try: `(-6_i32)`
@@ -8,160 +8,256 @@ LL | let _ = (-6_i32).min(9);
8
8
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_min_or_max)]`
9
9
10
10
error: `(-6_i32)` is never greater than `9` and has therefore no effect
11
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:6 :13
11
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:14 :13
12
12
|
13
13
LL | let _ = (-6_i32).max(9);
14
14
| ^^^^^^^^^^^^^^^ help: try: `9`
15
15
16
16
error: `9_u32` is never smaller than `6` and has therefore no effect
17
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:7 :13
17
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:15 :13
18
18
|
19
19
LL | let _ = 9_u32.min(6);
20
20
| ^^^^^^^^^^^^ help: try: `6`
21
21
22
22
error: `9_u32` is never smaller than `6` and has therefore no effect
23
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:8 :13
23
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:16 :13
24
24
|
25
25
LL | let _ = 9_u32.max(6);
26
26
| ^^^^^^^^^^^^ help: try: `9_u32`
27
27
28
28
error: `6` is never greater than `7_u8` and has therefore no effect
29
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:9 :13
29
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:17 :13
30
30
|
31
31
LL | let _ = 6.min(7_u8);
32
32
| ^^^^^^^^^^^ help: try: `6`
33
33
34
34
error: `6` is never greater than `7_u8` and has therefore no effect
35
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:10 :13
35
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:18 :13
36
36
|
37
37
LL | let _ = 6.max(7_u8);
38
38
| ^^^^^^^^^^^ help: try: `7_u8`
39
39
40
+ error: `X` is never greater than `12` and has therefore no effect
41
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:20:13
42
+ |
43
+ LL | let _ = X.max(12);
44
+ | ^^^^^^^^^ help: try: `12`
45
+
46
+ error: `X` is never greater than `12` and has therefore no effect
47
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:21:13
48
+ |
49
+ LL | let _ = X.min(12);
50
+ | ^^^^^^^^^ help: try: `X`
51
+
52
+ error: `12` is never smaller than `X` and has therefore no effect
53
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:22:13
54
+ |
55
+ LL | let _ = 12.min(X);
56
+ | ^^^^^^^^^ help: try: `X`
57
+
58
+ error: `12` is never smaller than `X` and has therefore no effect
59
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:23:13
60
+ |
61
+ LL | let _ = 12.max(X);
62
+ | ^^^^^^^^^ help: try: `12`
63
+
64
+ error: `(X + 1)` is never greater than `12` and has therefore no effect
65
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:24:13
66
+ |
67
+ LL | let _ = (X + 1).max(12);
68
+ | ^^^^^^^^^^^^^^^ help: try: `12`
69
+
70
+ error: `(X + 1)` is never greater than `12` and has therefore no effect
71
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:25:13
72
+ |
73
+ LL | let _ = (X + 1).min(12);
74
+ | ^^^^^^^^^^^^^^^ help: try: `(X + 1)`
75
+
76
+ error: `12` is never smaller than `X - 1` and has therefore no effect
77
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:26:13
78
+ |
79
+ LL | let _ = 12.min(X - 1);
80
+ | ^^^^^^^^^^^^^ help: try: `X - 1`
81
+
82
+ error: `12` is never smaller than `X - 1` and has therefore no effect
83
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:27:13
84
+ |
85
+ LL | let _ = 12.max(X - 1);
86
+ | ^^^^^^^^^^^^^ help: try: `12`
87
+
40
88
error: `i32::MIN` is never greater than `x` and has therefore no effect
41
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:14 :13
89
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:31 :13
42
90
|
43
91
LL | let _ = i32::MIN.min(x);
44
92
| ^^^^^^^^^^^^^^^ help: try: `i32::MIN`
45
93
46
94
error: `i32::MIN` is never greater than `x` and has therefore no effect
47
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:15 :13
95
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:32 :13
48
96
|
49
97
LL | let _ = i32::MIN.max(x);
50
98
| ^^^^^^^^^^^^^^^ help: try: `x`
51
99
52
100
error: `x` is never smaller than `i32::MIN` and has therefore no effect
53
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:16 :13
101
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:33 :13
54
102
|
55
103
LL | let _ = x.min(i32::MIN);
56
104
| ^^^^^^^^^^^^^^^ help: try: `i32::MIN`
57
105
58
106
error: `x` is never smaller than `i32::MIN` and has therefore no effect
59
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:17 :13
107
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:34 :13
60
108
|
61
109
LL | let _ = x.max(i32::MIN);
62
110
| ^^^^^^^^^^^^^^^ help: try: `x`
63
111
64
112
error: `i32::MAX` is never smaller than `x` and has therefore no effect
65
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:20 :13
113
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:37 :13
66
114
|
67
115
LL | let _ = i32::MAX.min(x);
68
116
| ^^^^^^^^^^^^^^^ help: try: `x`
69
117
70
118
error: `i32::MAX` is never smaller than `x` and has therefore no effect
71
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:21 :13
119
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:38 :13
72
120
|
73
121
LL | let _ = i32::MAX.max(x);
74
122
| ^^^^^^^^^^^^^^^ help: try: `i32::MAX`
75
123
76
124
error: `x` is never greater than `i32::MAX` and has therefore no effect
77
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:22 :13
125
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:39 :13
78
126
|
79
127
LL | let _ = x.min(i32::MAX);
80
128
| ^^^^^^^^^^^^^^^ help: try: `x`
81
129
82
130
error: `x` is never greater than `i32::MAX` and has therefore no effect
83
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:23 :13
131
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:40 :13
84
132
|
85
133
LL | let _ = x.max(i32::MAX);
86
134
| ^^^^^^^^^^^^^^^ help: try: `i32::MAX`
87
135
88
136
error: `u32::MAX` is never smaller than `x` and has therefore no effect
89
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:27 :13
137
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:44 :13
90
138
|
91
139
LL | let _ = u32::MAX.min(x);
92
140
| ^^^^^^^^^^^^^^^ help: try: `x`
93
141
94
142
error: `u32::MAX` is never smaller than `x` and has therefore no effect
95
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:28 :13
143
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:45 :13
96
144
|
97
145
LL | let _ = u32::MAX.max(x);
98
146
| ^^^^^^^^^^^^^^^ help: try: `u32::MAX`
99
147
100
148
error: `x` is never greater than `u32::MAX` and has therefore no effect
101
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:29 :13
149
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:46 :13
102
150
|
103
151
LL | let _ = x.min(u32::MAX);
104
152
| ^^^^^^^^^^^^^^^ help: try: `x`
105
153
106
154
error: `x` is never greater than `u32::MAX` and has therefore no effect
107
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:30 :13
155
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:47 :13
108
156
|
109
157
LL | let _ = x.max(u32::MAX);
110
158
| ^^^^^^^^^^^^^^^ help: try: `u32::MAX`
111
159
112
160
error: `u32::MIN` is never greater than `x` and has therefore no effect
113
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:33 :13
161
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:50 :13
114
162
|
115
163
LL | let _ = u32::MIN.min(x);
116
164
| ^^^^^^^^^^^^^^^ help: try: `u32::MIN`
117
165
118
166
error: `u32::MIN` is never greater than `x` and has therefore no effect
119
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:34 :13
167
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:51 :13
120
168
|
121
169
LL | let _ = u32::MIN.max(x);
122
170
| ^^^^^^^^^^^^^^^ help: try: `x`
123
171
124
172
error: `x` is never smaller than `u32::MIN` and has therefore no effect
125
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:35 :13
173
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:52 :13
126
174
|
127
175
LL | let _ = x.min(u32::MIN);
128
176
| ^^^^^^^^^^^^^^^ help: try: `u32::MIN`
129
177
130
178
error: `x` is never smaller than `u32::MIN` and has therefore no effect
131
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:36 :13
179
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:53 :13
132
180
|
133
181
LL | let _ = x.max(u32::MIN);
134
182
| ^^^^^^^^^^^^^^^ help: try: `x`
135
183
136
184
error: `0` is never greater than `x` and has therefore no effect
137
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:39 :13
185
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:56 :13
138
186
|
139
187
LL | let _ = 0.min(x);
140
188
| ^^^^^^^^ help: try: `0`
141
189
142
190
error: `0` is never greater than `x` and has therefore no effect
143
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:40 :13
191
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:57 :13
144
192
|
145
193
LL | let _ = 0.max(x);
146
194
| ^^^^^^^^ help: try: `x`
147
195
148
196
error: `x` is never smaller than `0_u32` and has therefore no effect
149
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:41 :13
197
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:58 :13
150
198
|
151
199
LL | let _ = x.min(0_u32);
152
200
| ^^^^^^^^^^^^ help: try: `0_u32`
153
201
154
202
error: `x` is never smaller than `0_u32` and has therefore no effect
155
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:42 :13
203
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:59 :13
156
204
|
157
205
LL | let _ = x.max(0_u32);
158
206
| ^^^^^^^^^^^^ help: try: `x`
159
207
160
208
error: `(6.0_f64)` is never smaller than `std::f64::consts::E` and has therefore no effect
161
- --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:44 :13
209
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:61 :13
162
210
|
163
211
LL | let _ = (6.0_f64).min(std::f64::consts::E);
164
212
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::f64::consts::E`
165
213
166
- error: aborting due to 27 previous errors
214
+ error: `2` is never smaller than `external_consts::MAGIC_NUMBER` and has therefore no effect
215
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:63:13
216
+ |
217
+ LL | let _ = 2.min(external_consts::MAGIC_NUMBER);
218
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `external_consts::MAGIC_NUMBER`
219
+
220
+ error: `2` is never smaller than `external_consts::MAGIC_NUMBER` and has therefore no effect
221
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:64:13
222
+ |
223
+ LL | let _ = 2.max(external_consts::MAGIC_NUMBER);
224
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `2`
225
+
226
+ error: `external_consts::MAGIC_NUMBER` is never greater than `2` and has therefore no effect
227
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:65:13
228
+ |
229
+ LL | let _ = external_consts::MAGIC_NUMBER.min(2);
230
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `external_consts::MAGIC_NUMBER`
231
+
232
+ error: `external_consts::MAGIC_NUMBER` is never greater than `2` and has therefore no effect
233
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:66:13
234
+ |
235
+ LL | let _ = external_consts::MAGIC_NUMBER.max(2);
236
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `2`
237
+
238
+ error: `X` is never smaller than `external_consts::MAGIC_NUMBER` and has therefore no effect
239
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:68:13
240
+ |
241
+ LL | let _ = X.min(external_consts::MAGIC_NUMBER);
242
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `external_consts::MAGIC_NUMBER`
243
+
244
+ error: `X` is never smaller than `external_consts::MAGIC_NUMBER` and has therefore no effect
245
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:69:13
246
+ |
247
+ LL | let _ = X.max(external_consts::MAGIC_NUMBER);
248
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `external_consts::MAGIC_NUMBER`
249
+
250
+ error: `external_consts::MAGIC_NUMBER` is never smaller than `X` and has therefore no effect
251
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:70:13
252
+ |
253
+ LL | let _ = external_consts::MAGIC_NUMBER.min(X);
254
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `X`
255
+
256
+ error: `external_consts::MAGIC_NUMBER` is never smaller than `X` and has therefore no effect
257
+ --> tests/ui-toml/unnecessary_min_or_max/unnecessary_min_or_max.rs:71:13
258
+ |
259
+ LL | let _ = external_consts::MAGIC_NUMBER.max(X);
260
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `X`
261
+
262
+ error: aborting due to 43 previous errors
167
263
0 commit comments