-
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.
Auto merge of #8350 - dswij:8331, r=Manishearth
fix bad suggestion on `numeric_literal` closes #8331 changelog: [`numeric_literal`] fix suggestion not showing sign
- Loading branch information
Showing
4 changed files
with
52 additions
and
13 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 |
---|---|---|
@@ -1,22 +1,52 @@ | ||
error: casting integer literal to `i32` is unnecessary | ||
--> $DIR/unnecessary_cast.rs:6:5 | ||
--> $DIR/unnecessary_cast.rs:7:5 | ||
| | ||
LL | 1i32 as i32; | ||
| ^^^^^^^^^^^ help: try: `1_i32` | ||
| | ||
= note: `-D clippy::unnecessary-cast` implied by `-D warnings` | ||
|
||
error: casting float literal to `f32` is unnecessary | ||
--> $DIR/unnecessary_cast.rs:7:5 | ||
--> $DIR/unnecessary_cast.rs:8:5 | ||
| | ||
LL | 1f32 as f32; | ||
| ^^^^^^^^^^^ help: try: `1_f32` | ||
|
||
error: casting to the same type is unnecessary (`bool` -> `bool`) | ||
--> $DIR/unnecessary_cast.rs:8:5 | ||
--> $DIR/unnecessary_cast.rs:9:5 | ||
| | ||
LL | false as bool; | ||
| ^^^^^^^^^^^^^ help: try: `false` | ||
|
||
error: aborting due to 3 previous errors | ||
error: casting integer literal to `i32` is unnecessary | ||
--> $DIR/unnecessary_cast.rs:12:5 | ||
| | ||
LL | -1_i32 as i32; | ||
| ^^^^^^^^^^^^^ help: try: `-1_i32` | ||
|
||
error: casting integer literal to `i32` is unnecessary | ||
--> $DIR/unnecessary_cast.rs:13:5 | ||
| | ||
LL | - 1_i32 as i32; | ||
| ^^^^^^^^^^^^^^ help: try: `- 1_i32` | ||
|
||
error: casting float literal to `f32` is unnecessary | ||
--> $DIR/unnecessary_cast.rs:14:5 | ||
| | ||
LL | -1f32 as f32; | ||
| ^^^^^^^^^^^^ help: try: `-1_f32` | ||
|
||
error: casting integer literal to `i32` is unnecessary | ||
--> $DIR/unnecessary_cast.rs:15:5 | ||
| | ||
LL | 1_i32 as i32; | ||
| ^^^^^^^^^^^^ help: try: `1_i32` | ||
|
||
error: casting float literal to `f32` is unnecessary | ||
--> $DIR/unnecessary_cast.rs:16:5 | ||
| | ||
LL | 1_f32 as f32; | ||
| ^^^^^^^^^^^^ help: try: `1_f32` | ||
|
||
error: aborting due to 8 previous errors | ||
|