forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 rust-lang#6895 - iobtl:reformat_unnecessary_cast, r=llogiq
replace span_lint with span_lint_and_sugg along with error message fixes: rust-lang#6874 changelog: none apologies if this may not be the most idiomatic way of doing it, any advice on changes (if any) would be greatly appreciated.
- Loading branch information
Showing
2 changed files
with
19 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
error: casting to the same type is unnecessary (`i32` -> `i32`) | ||
error: casting integer literal to `i32` is unnecessary | ||
--> $DIR/unnecessary_cast.rs:6:5 | ||
| | ||
LL | 1i32 as i32; | ||
| ^^^^^^^^^^^ | ||
| ^^^^^^^^^^^ help: try: `1_i32` | ||
| | ||
= note: `-D clippy::unnecessary-cast` implied by `-D warnings` | ||
|
||
error: casting to the same type is unnecessary (`f32` -> `f32`) | ||
error: casting float literal to `f32` is unnecessary | ||
--> $DIR/unnecessary_cast.rs:7: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 | ||
| | ||
LL | false as bool; | ||
| ^^^^^^^^^^^^^ | ||
| ^^^^^^^^^^^^^ help: try: `false` | ||
|
||
error: aborting due to 3 previous errors | ||
|