about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-01-20 15:16:36 -0800
committerEsteban Küber <esteban@kuber.com.ar>2019-01-20 15:16:36 -0800
commitdefa61f3fb2612358b57c206c5e16da2751e6deb (patch)
tree16dda63e86fa58940291a5a176918e1e9efe92ed /src/test/ui
parent15bad8bbfd3125b1e94d04f274910e24d0bb63eb (diff)
Tweak field parse error recovery
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/issues/issue-52496.rs3
-rw-r--r--src/test/ui/issues/issue-52496.stderr19
-rw-r--r--src/test/ui/parser/removed-syntax-with-1.rs2
-rw-r--r--src/test/ui/parser/removed-syntax-with-1.stderr4
-rw-r--r--src/test/ui/parser/removed-syntax-with-2.rs3
-rw-r--r--src/test/ui/parser/removed-syntax-with-2.stderr19
6 files changed, 14 insertions, 36 deletions
diff --git a/src/test/ui/issues/issue-52496.rs b/src/test/ui/issues/issue-52496.rs
index e9ffeaf6c89..4e945365373 100644
--- a/src/test/ui/issues/issue-52496.rs
+++ b/src/test/ui/issues/issue-52496.rs
@@ -7,7 +7,6 @@ fn main() {
     let bar = 1.5f32;
     let _ = Foo { bar.into(), bat: -1, . };
     //~^ ERROR expected one of
-    //~| ERROR mismatched types
-    //~| ERROR missing field `baz` in initializer of `Foo`
+    //~| ERROR missing fields `bar`, `baz` in initializer of `Foo`
     //~| ERROR expected identifier, found `.`
 }
diff --git a/src/test/ui/issues/issue-52496.stderr b/src/test/ui/issues/issue-52496.stderr
index 12fe7e7fc1f..43009a15bd4 100644
--- a/src/test/ui/issues/issue-52496.stderr
+++ b/src/test/ui/issues/issue-52496.stderr
@@ -26,23 +26,12 @@ error[E0063]: missing field `bat` in initializer of `Foo`
 LL |     let _ = Foo { bar: .5, baz: 42 };
    |             ^^^ missing `bat`
 
-error[E0308]: mismatched types
-  --> $DIR/issue-52496.rs:8:19
-   |
-LL |     let _ = Foo { bar.into(), bat: -1, . };
-   |                   ^^^ expected f64, found f32
-help: you can cast an `f32` to `f64` in a lossless way
-   |
-LL |     let _ = Foo { bar.into().into(), bat: -1, . };
-   |                   ^^^^^^^^^^
-
-error[E0063]: missing field `baz` in initializer of `Foo`
+error[E0063]: missing fields `bar`, `baz` in initializer of `Foo`
   --> $DIR/issue-52496.rs:8:13
    |
 LL |     let _ = Foo { bar.into(), bat: -1, . };
-   |             ^^^ missing `baz`
+   |             ^^^ missing `bar`, `baz`
 
-error: aborting due to 6 previous errors
+error: aborting due to 5 previous errors
 
-Some errors occurred: E0063, E0308.
-For more information about an error, try `rustc --explain E0063`.
+For more information about this error, try `rustc --explain E0063`.
diff --git a/src/test/ui/parser/removed-syntax-with-1.rs b/src/test/ui/parser/removed-syntax-with-1.rs
index 57cbe8d5be6..add024ea390 100644
--- a/src/test/ui/parser/removed-syntax-with-1.rs
+++ b/src/test/ui/parser/removed-syntax-with-1.rs
@@ -7,5 +7,5 @@ fn main() {
     let a = S { foo: (), bar: () };
     let b = S { foo: () with a };
     //~^ ERROR expected one of `,`, `.`, `?`, `}`, or an operator, found `with`
-    //~| ERROR missing field `bar` in initializer of `main::S`
+    //~| ERROR missing fields `bar`, `foo` in initializer of `main::S`
 }
diff --git a/src/test/ui/parser/removed-syntax-with-1.stderr b/src/test/ui/parser/removed-syntax-with-1.stderr
index b5956ad339d..aae29efa85e 100644
--- a/src/test/ui/parser/removed-syntax-with-1.stderr
+++ b/src/test/ui/parser/removed-syntax-with-1.stderr
@@ -6,11 +6,11 @@ LL |     let b = S { foo: () with a };
    |             |
    |             while parsing this struct
 
-error[E0063]: missing field `bar` in initializer of `main::S`
+error[E0063]: missing fields `bar`, `foo` in initializer of `main::S`
   --> $DIR/removed-syntax-with-1.rs:8:13
    |
 LL |     let b = S { foo: () with a };
-   |             ^ missing `bar`
+   |             ^ missing `bar`, `foo`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/parser/removed-syntax-with-2.rs b/src/test/ui/parser/removed-syntax-with-2.rs
index 11db391c548..f666da49696 100644
--- a/src/test/ui/parser/removed-syntax-with-2.rs
+++ b/src/test/ui/parser/removed-syntax-with-2.rs
@@ -7,6 +7,5 @@ fn main() {
     let a = S { foo: (), bar: () };
     let b = S { foo: (), with a };
     //~^ ERROR expected one of `,` or `}`, found `a`
-    //~| ERROR cannot find value `with` in this scope
-    //~| ERROR struct `main::S` has no field named `with`
+    //~| ERROR missing field `bar` in initializer of `main::S`
 }
diff --git a/src/test/ui/parser/removed-syntax-with-2.stderr b/src/test/ui/parser/removed-syntax-with-2.stderr
index ee7560017a6..7717b49d3a2 100644
--- a/src/test/ui/parser/removed-syntax-with-2.stderr
+++ b/src/test/ui/parser/removed-syntax-with-2.stderr
@@ -6,21 +6,12 @@ LL |     let b = S { foo: (), with a };
    |             |
    |             while parsing this struct
 
-error[E0425]: cannot find value `with` in this scope
-  --> $DIR/removed-syntax-with-2.rs:8:26
+error[E0063]: missing field `bar` in initializer of `main::S`
+  --> $DIR/removed-syntax-with-2.rs:8:13
    |
 LL |     let b = S { foo: (), with a };
-   |                          ^^^^ not found in this scope
+   |             ^ missing `bar`
 
-error[E0560]: struct `main::S` has no field named `with`
-  --> $DIR/removed-syntax-with-2.rs:8:26
-   |
-LL |     let b = S { foo: (), with a };
-   |                          ^^^^ `main::S` does not have this field
-   |
-   = note: available fields are: `foo`, `bar`
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
-Some errors occurred: E0425, E0560.
-For more information about an error, try `rustc --explain E0425`.
+For more information about this error, try `rustc --explain E0063`.