2020-01-06 06:36:33 +00:00
|
|
|
error: casting integer literal to `f32` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:13:5
|
2019-08-04 06:24:23 +00:00
|
|
|
|
|
|
|
|
LL | 100 as f32;
|
|
|
|
| ^^^^^^^^^^ help: try: `100_f32`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-cast` implied by `-D warnings`
|
|
|
|
|
2020-01-06 06:36:33 +00:00
|
|
|
error: casting integer literal to `f64` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:14:5
|
2019-08-04 06:24:23 +00:00
|
|
|
|
|
|
|
|
LL | 100 as f64;
|
|
|
|
| ^^^^^^^^^^ help: try: `100_f64`
|
|
|
|
|
2020-01-06 06:36:33 +00:00
|
|
|
error: casting integer literal to `f64` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:15:5
|
2019-08-04 06:24:23 +00:00
|
|
|
|
|
|
|
|
LL | 100_i32 as f64;
|
|
|
|
| ^^^^^^^^^^^^^^ help: try: `100_f64`
|
|
|
|
|
2020-10-23 21:40:57 +00:00
|
|
|
error: casting integer literal to `f32` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:16:13
|
2020-10-23 21:40:57 +00:00
|
|
|
|
|
|
|
|
LL | let _ = -100 as f32;
|
|
|
|
| ^^^^^^^^^^^ help: try: `-100_f32`
|
|
|
|
|
|
|
|
error: casting integer literal to `f64` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:17:13
|
2020-10-23 21:40:57 +00:00
|
|
|
|
|
|
|
|
LL | let _ = -100 as f64;
|
|
|
|
| ^^^^^^^^^^^ help: try: `-100_f64`
|
|
|
|
|
|
|
|
error: casting integer literal to `f64` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:18:13
|
2020-10-23 21:40:57 +00:00
|
|
|
|
|
|
|
|
LL | let _ = -100_i32 as f64;
|
|
|
|
| ^^^^^^^^^^^^^^^ help: try: `-100_f64`
|
|
|
|
|
2020-11-22 00:08:32 +00:00
|
|
|
error: casting float literal to `f32` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:19:5
|
2020-11-22 00:08:32 +00:00
|
|
|
|
|
|
|
|
LL | 100. as f32;
|
|
|
|
| ^^^^^^^^^^^ help: try: `100_f32`
|
|
|
|
|
|
|
|
error: casting float literal to `f64` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:20:5
|
2020-11-22 00:08:32 +00:00
|
|
|
|
|
|
|
|
LL | 100. as f64;
|
|
|
|
| ^^^^^^^^^^^ help: try: `100_f64`
|
|
|
|
|
2020-10-15 22:22:35 +00:00
|
|
|
error: casting integer literal to `u32` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:32:5
|
2020-10-15 22:22:35 +00:00
|
|
|
|
|
|
|
|
LL | 1 as u32;
|
|
|
|
| ^^^^^^^^ help: try: `1_u32`
|
|
|
|
|
|
|
|
error: casting integer literal to `i32` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:33:5
|
2020-10-15 22:22:35 +00:00
|
|
|
|
|
|
|
|
LL | 0x10 as i32;
|
2020-10-22 21:53:50 +00:00
|
|
|
| ^^^^^^^^^^^ help: try: `0x10_i32`
|
2020-10-15 22:22:35 +00:00
|
|
|
|
|
|
|
error: casting integer literal to `usize` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:34:5
|
2020-10-15 22:22:35 +00:00
|
|
|
|
|
|
|
|
LL | 0b10 as usize;
|
2020-10-22 21:53:50 +00:00
|
|
|
| ^^^^^^^^^^^^^ help: try: `0b10_usize`
|
2020-10-15 22:22:35 +00:00
|
|
|
|
2020-10-22 21:53:50 +00:00
|
|
|
error: casting integer literal to `u16` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:35:5
|
2020-10-22 21:53:50 +00:00
|
|
|
|
|
|
|
|
LL | 0o73 as u16;
|
|
|
|
| ^^^^^^^^^^^ help: try: `0o73_u16`
|
|
|
|
|
|
|
|
error: casting integer literal to `u32` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:36:5
|
2020-10-15 22:22:35 +00:00
|
|
|
|
|
2020-10-22 21:53:50 +00:00
|
|
|
LL | 1_000_000_000 as u32;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `1_000_000_000_u32`
|
|
|
|
|
|
|
|
error: casting float literal to `f64` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:38:5
|
2020-10-22 21:53:50 +00:00
|
|
|
|
|
2020-10-15 22:22:35 +00:00
|
|
|
LL | 1.0 as f64;
|
|
|
|
| ^^^^^^^^^^ help: try: `1.0_f64`
|
|
|
|
|
|
|
|
error: casting float literal to `f32` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:39:5
|
2020-10-15 22:22:35 +00:00
|
|
|
|
|
|
|
|
LL | 0.5 as f32;
|
|
|
|
| ^^^^^^^^^^ help: try: `0.5_f32`
|
|
|
|
|
2020-10-22 22:04:27 +00:00
|
|
|
error: casting integer literal to `i32` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:43:13
|
2020-10-22 22:04:27 +00:00
|
|
|
|
|
2020-10-22 22:04:27 +00:00
|
|
|
LL | let _ = -1 as i32;
|
|
|
|
| ^^^^^^^^^ help: try: `-1_i32`
|
2020-10-22 22:04:27 +00:00
|
|
|
|
|
|
|
error: casting float literal to `f32` is unnecessary
|
2022-01-02 13:26:44 +00:00
|
|
|
--> $DIR/unnecessary_cast_fixable.rs:44:13
|
2020-10-22 22:04:27 +00:00
|
|
|
|
|
2020-10-22 22:04:27 +00:00
|
|
|
LL | let _ = -1.0 as f32;
|
|
|
|
| ^^^^^^^^^^^ help: try: `-1.0_f32`
|
2020-10-22 22:04:27 +00:00
|
|
|
|
2020-11-22 00:08:32 +00:00
|
|
|
error: aborting due to 17 previous errors
|
2019-08-04 06:24:23 +00:00
|
|
|
|