2021-03-25 13:29:11 -05:00
|
|
|
error: casting integer literal to `i32` is unnecessary
|
2022-06-04 06:34:07 -05:00
|
|
|
--> $DIR/unnecessary_cast.rs:14:5
|
2019-08-04 01:24:23 -05:00
|
|
|
|
|
|
|
|
LL | 1i32 as i32;
|
2021-03-25 13:29:11 -05:00
|
|
|
| ^^^^^^^^^^^ help: try: `1_i32`
|
2019-08-04 01:24:23 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-cast` implied by `-D warnings`
|
|
|
|
|
2021-03-25 13:29:11 -05:00
|
|
|
error: casting float literal to `f32` is unnecessary
|
2022-06-04 06:34:07 -05:00
|
|
|
--> $DIR/unnecessary_cast.rs:15:5
|
2019-08-04 01:24:23 -05:00
|
|
|
|
|
|
|
|
LL | 1f32 as f32;
|
2021-03-25 13:29:11 -05:00
|
|
|
| ^^^^^^^^^^^ help: try: `1_f32`
|
2019-08-04 01:24:23 -05:00
|
|
|
|
|
|
|
error: casting to the same type is unnecessary (`bool` -> `bool`)
|
2022-06-04 06:34:07 -05:00
|
|
|
--> $DIR/unnecessary_cast.rs:16:5
|
2019-08-04 01:24:23 -05:00
|
|
|
|
|
|
|
|
LL | false as bool;
|
2021-03-25 13:29:11 -05:00
|
|
|
| ^^^^^^^^^^^^^ help: try: `false`
|
2019-08-04 01:24:23 -05:00
|
|
|
|
2022-01-27 08:12:45 -06:00
|
|
|
error: casting integer literal to `i32` is unnecessary
|
2022-06-04 06:34:07 -05:00
|
|
|
--> $DIR/unnecessary_cast.rs:19:5
|
2022-01-27 08:12:45 -06:00
|
|
|
|
|
|
|
|
LL | -1_i32 as i32;
|
|
|
|
| ^^^^^^^^^^^^^ help: try: `-1_i32`
|
|
|
|
|
|
|
|
error: casting integer literal to `i32` is unnecessary
|
2022-06-04 06:34:07 -05:00
|
|
|
--> $DIR/unnecessary_cast.rs:20:5
|
2022-01-27 08:12:45 -06:00
|
|
|
|
|
|
|
|
LL | - 1_i32 as i32;
|
|
|
|
| ^^^^^^^^^^^^^^ help: try: `- 1_i32`
|
|
|
|
|
|
|
|
error: casting float literal to `f32` is unnecessary
|
2022-06-04 06:34:07 -05:00
|
|
|
--> $DIR/unnecessary_cast.rs:21:5
|
2022-01-27 08:12:45 -06:00
|
|
|
|
|
|
|
|
LL | -1f32 as f32;
|
|
|
|
| ^^^^^^^^^^^^ help: try: `-1_f32`
|
|
|
|
|
|
|
|
error: casting integer literal to `i32` is unnecessary
|
2022-06-04 06:34:07 -05:00
|
|
|
--> $DIR/unnecessary_cast.rs:22:5
|
2022-01-27 08:12:45 -06:00
|
|
|
|
|
|
|
|
LL | 1_i32 as i32;
|
|
|
|
| ^^^^^^^^^^^^ help: try: `1_i32`
|
|
|
|
|
|
|
|
error: casting float literal to `f32` is unnecessary
|
2022-06-04 06:34:07 -05:00
|
|
|
--> $DIR/unnecessary_cast.rs:23:5
|
2022-01-27 08:12:45 -06:00
|
|
|
|
|
|
|
|
LL | 1_f32 as f32;
|
|
|
|
| ^^^^^^^^^^^^ help: try: `1_f32`
|
|
|
|
|
2022-06-04 06:34:07 -05:00
|
|
|
error: casting integer literal to `f32` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:53:9
|
|
|
|
|
|
|
|
|
LL | 100 as f32;
|
|
|
|
| ^^^^^^^^^^ help: try: `100_f32`
|
|
|
|
|
|
|
|
error: casting integer literal to `f64` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:54:9
|
|
|
|
|
|
|
|
|
LL | 100 as f64;
|
|
|
|
| ^^^^^^^^^^ help: try: `100_f64`
|
|
|
|
|
|
|
|
error: casting integer literal to `f64` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:55:9
|
|
|
|
|
|
|
|
|
LL | 100_i32 as f64;
|
|
|
|
| ^^^^^^^^^^^^^^ help: try: `100_f64`
|
|
|
|
|
|
|
|
error: casting integer literal to `f32` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:56:17
|
|
|
|
|
|
|
|
|
LL | let _ = -100 as f32;
|
|
|
|
| ^^^^^^^^^^^ help: try: `-100_f32`
|
|
|
|
|
|
|
|
error: casting integer literal to `f64` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:57:17
|
|
|
|
|
|
|
|
|
LL | let _ = -100 as f64;
|
|
|
|
| ^^^^^^^^^^^ help: try: `-100_f64`
|
|
|
|
|
|
|
|
error: casting integer literal to `f64` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:58:17
|
|
|
|
|
|
|
|
|
LL | let _ = -100_i32 as f64;
|
|
|
|
| ^^^^^^^^^^^^^^^ help: try: `-100_f64`
|
|
|
|
|
|
|
|
error: casting float literal to `f32` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:59:9
|
|
|
|
|
|
|
|
|
LL | 100. as f32;
|
|
|
|
| ^^^^^^^^^^^ help: try: `100_f32`
|
|
|
|
|
|
|
|
error: casting float literal to `f64` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:60:9
|
|
|
|
|
|
|
|
|
LL | 100. as f64;
|
|
|
|
| ^^^^^^^^^^^ help: try: `100_f64`
|
|
|
|
|
|
|
|
error: casting integer literal to `u32` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:72:9
|
|
|
|
|
|
|
|
|
LL | 1 as u32;
|
|
|
|
| ^^^^^^^^ help: try: `1_u32`
|
|
|
|
|
|
|
|
error: casting integer literal to `i32` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:73:9
|
|
|
|
|
|
|
|
|
LL | 0x10 as i32;
|
|
|
|
| ^^^^^^^^^^^ help: try: `0x10_i32`
|
|
|
|
|
|
|
|
error: casting integer literal to `usize` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:74:9
|
|
|
|
|
|
|
|
|
LL | 0b10 as usize;
|
|
|
|
| ^^^^^^^^^^^^^ help: try: `0b10_usize`
|
|
|
|
|
|
|
|
error: casting integer literal to `u16` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:75:9
|
|
|
|
|
|
|
|
|
LL | 0o73 as u16;
|
|
|
|
| ^^^^^^^^^^^ help: try: `0o73_u16`
|
|
|
|
|
|
|
|
error: casting integer literal to `u32` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:76:9
|
|
|
|
|
|
|
|
|
LL | 1_000_000_000 as u32;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `1_000_000_000_u32`
|
|
|
|
|
|
|
|
error: casting float literal to `f64` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:78:9
|
|
|
|
|
|
|
|
|
LL | 1.0 as f64;
|
|
|
|
| ^^^^^^^^^^ help: try: `1.0_f64`
|
|
|
|
|
|
|
|
error: casting float literal to `f32` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:79:9
|
|
|
|
|
|
|
|
|
LL | 0.5 as f32;
|
|
|
|
| ^^^^^^^^^^ help: try: `0.5_f32`
|
|
|
|
|
|
|
|
error: casting integer literal to `i32` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:83:17
|
|
|
|
|
|
|
|
|
LL | let _ = -1 as i32;
|
|
|
|
| ^^^^^^^^^ help: try: `-1_i32`
|
|
|
|
|
|
|
|
error: casting float literal to `f32` is unnecessary
|
|
|
|
--> $DIR/unnecessary_cast.rs:84:17
|
|
|
|
|
|
|
|
|
LL | let _ = -1.0 as f32;
|
|
|
|
| ^^^^^^^^^^^ help: try: `-1.0_f32`
|
|
|
|
|
|
|
|
error: aborting due to 25 previous errors
|
2019-08-04 01:24:23 -05:00
|
|
|
|