summaryrefslogtreecommitdiffstats
path: root/tests/ui/span/recursive-type-field.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/span/recursive-type-field.rs')
-rw-r--r--tests/ui/span/recursive-type-field.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/span/recursive-type-field.rs b/tests/ui/span/recursive-type-field.rs
new file mode 100644
index 000000000..bd4c43534
--- /dev/null
+++ b/tests/ui/span/recursive-type-field.rs
@@ -0,0 +1,18 @@
+use std::rc::Rc;
+
+struct Foo<'a> { //~ ERROR recursive types `Foo` and `Bar` have infinite size
+ bar: Bar<'a>,
+ b: Rc<Bar<'a>>,
+}
+
+struct Bar<'a> {
+ y: (Foo<'a>, Foo<'a>),
+ z: Option<Bar<'a>>,
+ a: &'a Foo<'a>,
+ c: &'a [Bar<'a>],
+ d: [Bar<'a>; 1],
+ e: Foo<'a>,
+ x: Bar<'a>,
+}
+
+fn main() {}