]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/recursive-type-field.stderr
d240872647e506771044e3fa7fcc7303d08d2450
[rust.git] / src / test / ui / span / recursive-type-field.stderr
1 error[E0072]: recursive type `Foo` has infinite size
2   --> $DIR/recursive-type-field.rs:3:1
3    |
4 LL | struct Foo<'a> {
5    | ^^^^^^^^^^^^^^ recursive type has infinite size
6 LL |     bar: Bar<'a>,
7    |     ------------ recursive without indirection
8    |
9    = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable
10
11 error[E0072]: recursive type `Bar` has infinite size
12   --> $DIR/recursive-type-field.rs:8:1
13    |
14 LL | struct Bar<'a> {
15    | ^^^^^^^^^^^^^^ recursive type has infinite size
16 LL |     y: (Foo<'a>, Foo<'a>),
17    |     --------------------- recursive without indirection
18 LL |     z: Option<Bar<'a>>,
19    |     ------------------ recursive without indirection
20 ...
21 LL |     d: [Bar<'a>; 1],
22    |     --------------- recursive without indirection
23 LL |     e: Foo<'a>,
24    |     ---------- recursive without indirection
25 LL |     x: Bar<'a>,
26    |     ---------- recursive without indirection
27    |
28    = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Bar` representable
29
30 error: aborting due to 2 previous errors
31
32 For more information about this error, try `rustc --explain E0072`.