-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename lint into
confusing_method_to_numeric_cast
- Loading branch information
1 parent
d93fba7
commit 042556c
Showing
8 changed files
with
37 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#![warn(clippy::confusing_method_to_numeric_cast)] | ||
|
||
fn main() { | ||
let _ = u16::MAX as usize; //~ confusing_method_to_numeric_cast | ||
} |
2 changes: 1 addition & 1 deletion
2
...ui/primitive_method_to_numeric_cast.fixed → tests/ui/confusing_method_to_numeric_cast.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#![warn(clippy::primitive_method_to_numeric_cast)] | ||
|
||
fn main() { | ||
let _ = u16::MAX as usize; //~ primitive_method_to_numeric_cast | ||
let _ = u16::max as usize; //~ confusing_method_to_numeric_cast | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
error: unknown lint: `clippy::primitive_method_to_numeric_cast` | ||
--> tests/ui/confusing_method_to_numeric_cast.rs:1:9 | ||
| | ||
LL | #![warn(clippy::primitive_method_to_numeric_cast)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::confusing_method_to_numeric_cast` | ||
| | ||
= note: `-D unknown-lints` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(unknown_lints)]` | ||
|
||
error: casting function pointer `u16::max` to `usize` | ||
--> tests/ui/confusing_method_to_numeric_cast.rs:4:13 | ||
| | ||
LL | let _ = u16::max as usize; | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `-D clippy::confusing-method-to-numeric-cast` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::confusing_method_to_numeric_cast)]` | ||
help: did you mean to use the associated constant? | ||
| | ||
LL | let _ = u16::MAX as usize; | ||
| ~~~~~~~~~~~~~~~~~ | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.