about summary refs log tree commit diff
path: root/tests/ui/terr-in-field.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/terr-in-field.rs')
-rw-r--r--tests/ui/terr-in-field.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/terr-in-field.rs b/tests/ui/terr-in-field.rs
new file mode 100644
index 00000000000..aa801fd0a6c
--- /dev/null
+++ b/tests/ui/terr-in-field.rs
@@ -0,0 +1,17 @@
+struct Foo {
+    a: isize,
+    b: isize,
+}
+
+struct Bar {
+    a: isize,
+    b: usize,
+}
+
+fn want_foo(f: Foo) {}
+fn have_bar(b: Bar) {
+    want_foo(b); //~  ERROR mismatched types
+                 //~| expected struct `Foo`, found struct `Bar`
+}
+
+fn main() {}