summaryrefslogtreecommitdiffstats
path: root/tests/ui/span/recursive-type-field.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/span/recursive-type-field.stderr')
-rw-r--r--tests/ui/span/recursive-type-field.stderr27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/span/recursive-type-field.stderr b/tests/ui/span/recursive-type-field.stderr
new file mode 100644
index 000000000..10af4c36b
--- /dev/null
+++ b/tests/ui/span/recursive-type-field.stderr
@@ -0,0 +1,27 @@
+error[E0072]: recursive types `Foo` and `Bar` have infinite size
+ --> $DIR/recursive-type-field.rs:3:1
+ |
+LL | struct Foo<'a> {
+ | ^^^^^^^^^^^^^^
+LL | bar: Bar<'a>,
+ | ------- recursive without indirection
+...
+LL | struct Bar<'a> {
+ | ^^^^^^^^^^^^^^
+LL | y: (Foo<'a>, Foo<'a>),
+ | ------- ------- recursive without indirection
+ | |
+ | recursive without indirection
+ |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
+ |
+LL ~ bar: Box<Bar<'a>>,
+LL | b: Rc<Bar<'a>>,
+ ...
+LL | struct Bar<'a> {
+LL ~ y: (Box<Foo<'a>>, Box<Foo<'a>>),
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0072`.