File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,6 @@ fn main() {
3030
3131 1.0 as u16;
3232
33- -1_i32;
34- -1.0_f32;
33+ let _ = -1_i32;
34+ let _ = -1.0_f32;
3535}
Original file line number Diff line number Diff line change @@ -30,6 +30,6 @@ fn main() {
3030
3131 1.0 as u16 ;
3232
33- -1 as i32 ;
34- -1.0 as f32 ;
33+ let _ = -1 as i32 ;
34+ let _ = -1.0 as f32 ;
3535}
Original file line number Diff line number Diff line change @@ -61,16 +61,16 @@ LL | 0.5 as f32;
6161 | ^^^^^^^^^^ help: try: `0.5_f32`
6262
6363error: casting integer literal to `i32` is unnecessary
64- --> $DIR/unnecessary_cast_fixable.rs:33:5
64+ --> $DIR/unnecessary_cast_fixable.rs:33:13
6565 |
66- LL | -1 as i32;
67- | ^^^^^^^^^ help: try: `-1_i32`
66+ LL | let _ = -1 as i32;
67+ | ^^^^^^^^^ help: try: `-1_i32`
6868
6969error: casting float literal to `f32` is unnecessary
70- --> $DIR/unnecessary_cast_fixable.rs:34:5
70+ --> $DIR/unnecessary_cast_fixable.rs:34:13
7171 |
72- LL | -1.0 as f32;
73- | ^^^^^^^^^^^ help: try: `-1.0_f32`
72+ LL | let _ = -1.0 as f32;
73+ | ^^^^^^^^^^^ help: try: `-1.0_f32`
7474
7575error: aborting due to 12 previous errors
7676
You can’t perform that action at this time.
0 commit comments