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() {
9797 u32::MAX;
9898 //~^ ERROR: usage of a legacy numeric method
9999 //~| 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
100107}
101108
102109#[warn(clippy::legacy_numeric_constants)]
Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ fn main() {
9797 ( <u32 >:: max_value ( ) ) ;
9898 //~^ ERROR: usage of a legacy numeric method
9999 //~| 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
100107}
101108
102109#[ warn( clippy:: legacy_numeric_constants) ]
Original file line number Diff line number Diff line change @@ -243,8 +243,32 @@ LL - (<u32>::max_value());
243243LL + u32::MAX;
244244 |
245245
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+
246270error: usage of a legacy numeric constant
247- --> tests/ui/legacy_numeric_constants.rs:131 :5
271+ --> tests/ui/legacy_numeric_constants.rs:138 :5
248272 |
249273LL | std::u32::MAX;
250274 | ^^^^^^^^^^^^^
@@ -255,5 +279,5 @@ LL - std::u32::MAX;
255279LL + u32::MAX;
256280 |
257281
258- error: aborting due to 21 previous errors
282+ error: aborting due to 23 previous errors
259283
You can’t perform that action at this time.
0 commit comments