Skip to content

Commit 30f80c3

Browse files
committed
Fix test file
1 parent 02f0110 commit 30f80c3

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

tests/ui/unnecessary_cast_fixable.fixed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

tests/ui/unnecessary_cast_fixable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

tests/ui/unnecessary_cast_fixable.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ LL | 0.5 as f32;
6161
| ^^^^^^^^^^ help: try: `0.5_f32`
6262

6363
error: 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

6969
error: 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

7575
error: aborting due to 12 previous errors
7676

0 commit comments

Comments
 (0)