about summary refs log tree commit diff
path: root/src/test/ui/structs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-01-02 11:59:15 +0000
committerbors <bors@rust-lang.org>2019-01-02 11:59:15 +0000
commita36b960df626cbb8bea74f01243318b73f0bd201 (patch)
tree233ab89fbff164488d8e345d4bfabcb86c5bba80 /src/test/ui/structs
parentd3704932bd3bf72fefe62fe4c4a1a0d9b37cec6b (diff)
parent710dcbd3818deca8f193a45e321b58af3c24feae (diff)
downloadrust-a36b960df626cbb8bea74f01243318b73f0bd201.tar.gz
rust-a36b960df626cbb8bea74f01243318b73f0bd201.zip
Auto merge of #57250 - codeworm96:tyerr_msg, r=varkor
Improve type mismatch error messages

Closes #56115.

Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.

TODO the book and clippy needs to be changed accordingly later.

r? @varkor
Diffstat (limited to 'src/test/ui/structs')
-rw-r--r--src/test/ui/structs/struct-base-wrong-type-2.rs2
-rw-r--r--src/test/ui/structs/struct-base-wrong-type-2.stderr2
-rw-r--r--src/test/ui/structs/struct-base-wrong-type.rs2
-rw-r--r--src/test/ui/structs/struct-base-wrong-type.stderr2
-rw-r--r--src/test/ui/structs/structure-constructor-type-mismatch.rs12
-rw-r--r--src/test/ui/structs/structure-constructor-type-mismatch.stderr22
6 files changed, 21 insertions, 21 deletions
diff --git a/src/test/ui/structs/struct-base-wrong-type-2.rs b/src/test/ui/structs/struct-base-wrong-type-2.rs
index a88c5d1c13b..562f75b8e85 100644
--- a/src/test/ui/structs/struct-base-wrong-type-2.rs
+++ b/src/test/ui/structs/struct-base-wrong-type-2.rs
@@ -15,5 +15,5 @@ fn main() {
     let f__isize = Foo { a: 2, ..4 }; //~  ERROR mismatched types
                                  //~| expected type `Foo`
                                  //~| found type `{integer}`
-                                 //~| expected struct `Foo`, found integral variable
+                                 //~| expected struct `Foo`, found integer
 }
diff --git a/src/test/ui/structs/struct-base-wrong-type-2.stderr b/src/test/ui/structs/struct-base-wrong-type-2.stderr
index 44ac3483ad6..b15ea51bb2d 100644
--- a/src/test/ui/structs/struct-base-wrong-type-2.stderr
+++ b/src/test/ui/structs/struct-base-wrong-type-2.stderr
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/struct-base-wrong-type-2.rs:15:34
    |
 LL |     let f__isize = Foo { a: 2, ..4 }; //~  ERROR mismatched types
-   |                                  ^ expected struct `Foo`, found integral variable
+   |                                  ^ expected struct `Foo`, found integer
    |
    = note: expected type `Foo`
               found type `{integer}`
diff --git a/src/test/ui/structs/struct-base-wrong-type.rs b/src/test/ui/structs/struct-base-wrong-type.rs
index 83b54448151..6252673c296 100644
--- a/src/test/ui/structs/struct-base-wrong-type.rs
+++ b/src/test/ui/structs/struct-base-wrong-type.rs
@@ -14,7 +14,7 @@ static foo: Foo = Foo { a: 2, ..bar }; //~  ERROR mismatched types
 static foo_i: Foo = Foo { a: 2, ..4 }; //~  ERROR mismatched types
                                        //~| expected type `Foo`
                                        //~| found type `{integer}`
-                                       //~| expected struct `Foo`, found integral variable
+                                       //~| expected struct `Foo`, found integer
 
 fn main() {
     let b = Bar { x: 5 };
diff --git a/src/test/ui/structs/struct-base-wrong-type.stderr b/src/test/ui/structs/struct-base-wrong-type.stderr
index 8519a9510a9..045eb610f7d 100644
--- a/src/test/ui/structs/struct-base-wrong-type.stderr
+++ b/src/test/ui/structs/struct-base-wrong-type.stderr
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/struct-base-wrong-type.rs:14:35
    |
 LL | static foo_i: Foo = Foo { a: 2, ..4 }; //~  ERROR mismatched types
-   |                                   ^ expected struct `Foo`, found integral variable
+   |                                   ^ expected struct `Foo`, found integer
    |
    = note: expected type `Foo`
               found type `{integer}`
diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.rs b/src/test/ui/structs/structure-constructor-type-mismatch.rs
index 54319e1ea4f..8850f6ea89f 100644
--- a/src/test/ui/structs/structure-constructor-type-mismatch.rs
+++ b/src/test/ui/structs/structure-constructor-type-mismatch.rs
@@ -16,32 +16,32 @@ fn main() {
     let pt = PointF {
         x: 1,
         //~^ ERROR mismatched types
-        //~| expected f32, found integral variable
+        //~| expected f32, found integer
         y: 2,
         //~^ ERROR mismatched types
-        //~| expected f32, found integral variable
+        //~| expected f32, found integer
     };
 
     let pt2 = Point::<f32> {
         x: 3,
         //~^ ERROR mismatched types
-        //~| expected f32, found integral variable
+        //~| expected f32, found integer
         y: 4,
         //~^ ERROR mismatched types
-        //~| expected f32, found integral variable
+        //~| expected f32, found integer
     };
 
     let pair = PairF {
         x: 5,
         //~^ ERROR mismatched types
-        //~| expected f32, found integral variable
+        //~| expected f32, found integer
         y: 6,
     };
 
     let pair2 = PairF::<i32> {
         x: 7,
         //~^ ERROR mismatched types
-        //~| expected f32, found integral variable
+        //~| expected f32, found integer
         y: 8,
     };
 
diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.stderr b/src/test/ui/structs/structure-constructor-type-mismatch.stderr
index 6abc75110e1..3c1ed8e69a6 100644
--- a/src/test/ui/structs/structure-constructor-type-mismatch.stderr
+++ b/src/test/ui/structs/structure-constructor-type-mismatch.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |         x: 1,
    |            ^
    |            |
-   |            expected f32, found integral variable
+   |            expected f32, found integer
    |            help: use a float literal: `1.0`
    |
    = note: expected type `f32`
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
 LL |         y: 2,
    |            ^
    |            |
-   |            expected f32, found integral variable
+   |            expected f32, found integer
    |            help: use a float literal: `2.0`
    |
    = note: expected type `f32`
@@ -28,7 +28,7 @@ error[E0308]: mismatched types
 LL |         x: 3,
    |            ^
    |            |
-   |            expected f32, found integral variable
+   |            expected f32, found integer
    |            help: use a float literal: `3.0`
    |
    = note: expected type `f32`
@@ -40,7 +40,7 @@ error[E0308]: mismatched types
 LL |         y: 4,
    |            ^
    |            |
-   |            expected f32, found integral variable
+   |            expected f32, found integer
    |            help: use a float literal: `4.0`
    |
    = note: expected type `f32`
@@ -52,7 +52,7 @@ error[E0308]: mismatched types
 LL |         x: 5,
    |            ^
    |            |
-   |            expected f32, found integral variable
+   |            expected f32, found integer
    |            help: use a float literal: `5.0`
    |
    = note: expected type `f32`
@@ -64,7 +64,7 @@ error[E0308]: mismatched types
 LL |         x: 7,
    |            ^
    |            |
-   |            expected f32, found integral variable
+   |            expected f32, found integer
    |            help: use a float literal: `7.0`
    |
    = note: expected type `f32`
@@ -82,7 +82,7 @@ error[E0308]: mismatched types
 LL |         x: 9,  //~ ERROR mismatched types
    |            ^
    |            |
-   |            expected f32, found integral variable
+   |            expected f32, found integer
    |            help: use a float literal: `9.0`
    |
    = note: expected type `f32`
@@ -94,7 +94,7 @@ error[E0308]: mismatched types
 LL |         y: 10, //~ ERROR mismatched types
    |            ^^
    |            |
-   |            expected f32, found integral variable
+   |            expected f32, found integer
    |            help: use a float literal: `10.0`
    |
    = note: expected type `f32`
@@ -110,7 +110,7 @@ error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:54:9
    |
 LL |         PointF::<u32> { .. } => {} //~ ERROR wrong number of type arguments
-   |         ^^^^^^^^^^^^^^^^^^^^ expected integral variable, found f32
+   |         ^^^^^^^^^^^^^^^^^^^^ expected integer, found f32
    |
    = note: expected type `Point<{integer}>`
               found type `Point<f32>`
@@ -119,7 +119,7 @@ error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:59:9
    |
 LL |         PointF { .. } => {} //~ ERROR mismatched types
-   |         ^^^^^^^^^^^^^ expected integral variable, found f32
+   |         ^^^^^^^^^^^^^ expected integer, found f32
    |
    = note: expected type `Point<{integer}>`
               found type `Point<f32>`
@@ -128,7 +128,7 @@ error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:67:9
    |
 LL |         PairF::<u32> { .. } => {} //~ ERROR mismatched types
-   |         ^^^^^^^^^^^^^^^^^^^ expected integral variable, found f32
+   |         ^^^^^^^^^^^^^^^^^^^ expected integer, found f32
    |
    = note: expected type `Pair<{integer}, {integer}>`
               found type `Pair<f32, u32>`