File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ fn main() {
97
97
u32::MAX;
98
98
//~^ ERROR: usage of a legacy numeric method
99
99
//~| HELP: use the associated constant instead
100
+ i32::MAX;
101
+ //~^ ERROR: usage of a legacy numeric method
102
+ //~| HELP: use the associated constant instead
103
+ type Ω = i32;
104
+ Ω::MAX;
105
+ //~^ ERROR: usage of a legacy numeric method
106
+ //~| HELP: use the associated constant instead
100
107
}
101
108
102
109
#[warn(clippy::legacy_numeric_constants)]
Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ fn main() {
97
97
( <u32 >:: max_value ( ) ) ;
98
98
//~^ ERROR: usage of a legacy numeric method
99
99
//~| HELP: use the associated constant instead
100
+ ( ( i32:: max_value) ( ) ) ;
101
+ //~^ ERROR: usage of a legacy numeric method
102
+ //~| HELP: use the associated constant instead
103
+ type Ω = i32 ;
104
+ Ω:: max_value ( ) ;
105
+ //~^ ERROR: usage of a legacy numeric method
106
+ //~| HELP: use the associated constant instead
100
107
}
101
108
102
109
#[ warn( clippy:: legacy_numeric_constants) ]
Original file line number Diff line number Diff line change @@ -243,8 +243,32 @@ LL - (<u32>::max_value());
243
243
LL + u32::MAX;
244
244
|
245
245
246
+ error: usage of a legacy numeric method
247
+ --> tests/ui/legacy_numeric_constants.rs:100:5
248
+ |
249
+ LL | ((i32::max_value)());
250
+ | ^^^^^^^^^^^^^^^^^^^^
251
+ |
252
+ help: use the associated constant instead
253
+ |
254
+ LL - ((i32::max_value)());
255
+ LL + i32::MAX;
256
+ |
257
+
258
+ error: usage of a legacy numeric method
259
+ --> tests/ui/legacy_numeric_constants.rs:104:5
260
+ |
261
+ LL | Ω::max_value();
262
+ | ^^^^^^^^^^^^^^
263
+ |
264
+ help: use the associated constant instead
265
+ |
266
+ LL - Ω::max_value();
267
+ LL + Ω::MAX;
268
+ |
269
+
246
270
error: usage of a legacy numeric constant
247
- --> tests/ui/legacy_numeric_constants.rs:131 :5
271
+ --> tests/ui/legacy_numeric_constants.rs:138 :5
248
272
|
249
273
LL | std::u32::MAX;
250
274
| ^^^^^^^^^^^^^
@@ -255,5 +279,5 @@ LL - std::u32::MAX;
255
279
LL + u32::MAX;
256
280
|
257
281
258
- error: aborting due to 21 previous errors
282
+ error: aborting due to 23 previous errors
259
283
You can’t perform that action at this time.
0 commit comments