2021-03-25 18:29:11 +00:00
|
|
|
error: casting integer literal to `i32` is unnecessary
|
2022-01-27 14:12:45 +00:00
|
|
|
--> $DIR/unnecessary_cast.rs:7:5
|
2019-08-04 06:24:23 +00:00
|
|
|
|
|
|
|
|
LL | 1i32 as i32;
|
2021-03-25 18:29:11 +00:00
|
|
|
| ^^^^^^^^^^^ help: try: `1_i32`
|
2019-08-04 06:24:23 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-cast` implied by `-D warnings`
|
|
|
|
|
2021-03-25 18:29:11 +00:00
|
|
|
error: casting float literal to `f32` is unnecessary
|
2022-01-27 14:12:45 +00:00
|
|
|
--> $DIR/unnecessary_cast.rs:8:5
|
2019-08-04 06:24:23 +00:00
|
|
|
|
|
|
|
|
LL | 1f32 as f32;
|
2021-03-25 18:29:11 +00:00
|
|
|
| ^^^^^^^^^^^ help: try: `1_f32`
|
2019-08-04 06:24:23 +00:00
|
|
|
|
|
|
|
error: casting to the same type is unnecessary (`bool` -> `bool`)
|
2022-01-27 14:12:45 +00:00
|
|
|
--> $DIR/unnecessary_cast.rs:9:5
|
2019-08-04 06:24:23 +00:00
|
|
|
|
|
|
|
|
LL | false as bool;
|
2021-03-25 18:29:11 +00:00
|
|
|
| ^^^^^^^^^^^^^ help: try: `false`
|
2019-08-04 06:24:23 +00:00
|
|
|
|
2022-01-27 14:12:45 +00:00
|
|
|
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
|
2019-08-04 06:24:23 +00:00
|
|
|
|