about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGeoffrey Copin <copin.geoffrey@gmail.com>2020-10-23 00:04:27 +0200
committerGeoffrey Copin <copin.geoffrey@gmail.com>2020-10-23 00:33:15 +0200
commit30f80c3b8c4fcb5d0db37b84a77a58303322cf4e (patch)
treee85e33055f945b71f62eabdcdb4bc23b34686921
parent02f01104bfbb935ee1c3c3971ccf055173e4f82b (diff)
downloadrust-30f80c3b8c4fcb5d0db37b84a77a58303322cf4e.tar.gz
rust-30f80c3b8c4fcb5d0db37b84a77a58303322cf4e.zip
Fix test file
-rw-r--r--tests/ui/unnecessary_cast_fixable.fixed4
-rw-r--r--tests/ui/unnecessary_cast_fixable.rs4
-rw-r--r--tests/ui/unnecessary_cast_fixable.stderr12
3 files changed, 10 insertions, 10 deletions
diff --git a/tests/ui/unnecessary_cast_fixable.fixed b/tests/ui/unnecessary_cast_fixable.fixed
index 2a13469b146..5aeb0340b26 100644
--- a/tests/ui/unnecessary_cast_fixable.fixed
+++ b/tests/ui/unnecessary_cast_fixable.fixed
@@ -30,6 +30,6 @@ fn main() {
 
     1.0 as u16;
 
-    -1_i32;
-    -1.0_f32;
+    let _ = -1_i32;
+    let _ = -1.0_f32;
 }
diff --git a/tests/ui/unnecessary_cast_fixable.rs b/tests/ui/unnecessary_cast_fixable.rs
index 65ddd3c7fbf..0f249c23055 100644
--- a/tests/ui/unnecessary_cast_fixable.rs
+++ b/tests/ui/unnecessary_cast_fixable.rs
@@ -30,6 +30,6 @@ fn main() {
 
     1.0 as u16;
 
-    -1 as i32;
-    -1.0 as f32;
+    let _ = -1 as i32;
+    let _ = -1.0 as f32;
 }
diff --git a/tests/ui/unnecessary_cast_fixable.stderr b/tests/ui/unnecessary_cast_fixable.stderr
index 26b23e315e3..5100e9798c4 100644
--- a/tests/ui/unnecessary_cast_fixable.stderr
+++ b/tests/ui/unnecessary_cast_fixable.stderr
@@ -61,16 +61,16 @@ LL |     0.5 as f32;
    |     ^^^^^^^^^^ help: try: `0.5_f32`
 
 error: casting integer literal to `i32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:33:5
+  --> $DIR/unnecessary_cast_fixable.rs:33:13
    |
-LL |     -1 as i32;
-   |     ^^^^^^^^^ help: try: `-1_i32`
+LL |     let _ = -1 as i32;
+   |             ^^^^^^^^^ help: try: `-1_i32`
 
 error: casting float literal to `f32` is unnecessary
-  --> $DIR/unnecessary_cast_fixable.rs:34:5
+  --> $DIR/unnecessary_cast_fixable.rs:34:13
    |
-LL |     -1.0 as f32;
-   |     ^^^^^^^^^^^ help: try: `-1.0_f32`
+LL |     let _ = -1.0 as f32;
+   |             ^^^^^^^^^^^ help: try: `-1.0_f32`
 
 error: aborting due to 12 previous errors