about summary refs log tree commit diff
path: root/src/test/ui/structs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-04-19 15:37:34 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-04-22 11:31:35 -0700
commit45bbd14db4f12172cfb4f00e46b1f65ced0dd224 (patch)
tree0ae8bac8b1f507007af5d1dc5502d4d77dd37e05 /src/test/ui/structs
parentc21fbfe7e310b9055ed6b7c46b7d37b831a516e3 (diff)
downloadrust-45bbd14db4f12172cfb4f00e46b1f65ced0dd224.tar.gz
rust-45bbd14db4f12172cfb4f00e46b1f65ced0dd224.zip
Continue evaluating after item-type checking
Diffstat (limited to 'src/test/ui/structs')
-rw-r--r--src/test/ui/structs/struct-base-wrong-type.rs9
-rw-r--r--src/test/ui/structs/struct-base-wrong-type.stderr20
2 files changed, 22 insertions, 7 deletions
diff --git a/src/test/ui/structs/struct-base-wrong-type.rs b/src/test/ui/structs/struct-base-wrong-type.rs
index 6252673c296..58aa35046d9 100644
--- a/src/test/ui/structs/struct-base-wrong-type.rs
+++ b/src/test/ui/structs/struct-base-wrong-type.rs
@@ -18,10 +18,7 @@ static foo_i: Foo = Foo { a: 2, ..4 }; //~  ERROR mismatched types
 
 fn main() {
     let b = Bar { x: 5 };
-    // errors below are no longer caught since error above causes
-    // compilation to abort before we bother checking function bodies.
-    // See also struct-base-wrong-type-2.rs, which checks that we
-    // would catch these errors eventually.
-    let f = Foo { a: 2, ..b };
-    let f__isize = Foo { a: 2, ..4 };
+    // See also struct-base-wrong-type-2.rs, which checks these errors on isolation.
+    let f = Foo { a: 2, ..b };        //~ ERROR mismatched types
+    let f__isize = Foo { a: 2, ..4 }; //~ ERROR mismatched types
 }
diff --git a/src/test/ui/structs/struct-base-wrong-type.stderr b/src/test/ui/structs/struct-base-wrong-type.stderr
index 2491296c5ef..00c2e1e0dd5 100644
--- a/src/test/ui/structs/struct-base-wrong-type.stderr
+++ b/src/test/ui/structs/struct-base-wrong-type.stderr
@@ -16,6 +16,24 @@ LL | static foo_i: Foo = Foo { a: 2, ..4 };
    = note: expected type `Foo`
               found type `{integer}`
 
-error: aborting due to 2 previous errors
+error[E0308]: mismatched types
+  --> $DIR/struct-base-wrong-type.rs:22:27
+   |
+LL |     let f = Foo { a: 2, ..b };
+   |                           ^ expected struct `Foo`, found struct `Bar`
+   |
+   = note: expected type `Foo`
+              found type `Bar`
+
+error[E0308]: mismatched types
+  --> $DIR/struct-base-wrong-type.rs:23:34
+   |
+LL |     let f__isize = Foo { a: 2, ..4 };
+   |                                  ^ expected struct `Foo`, found integer
+   |
+   = note: expected type `Foo`
+              found type `{integer}`
+
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0308`.