error[E0072]: recursive type `Foo` has infinite size --> $DIR/recursive-type-field.rs:3:1 | LL | struct Foo<'a> { | ^^^^^^^^^^^^^^ recursive type has infinite size LL | bar: Bar<'a>, | ------------ recursive without indirection | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable error[E0072]: recursive type `Bar` has infinite size --> $DIR/recursive-type-field.rs:8:1 | LL | struct Bar<'a> { | ^^^^^^^^^^^^^^ recursive type has infinite size LL | y: (Foo<'a>, Foo<'a>), | --------------------- recursive without indirection LL | z: Option>, | ------------------ recursive without indirection ... LL | d: [Bar<'a>; 1], | --------------- recursive without indirection LL | e: Foo<'a>, | ---------- recursive without indirection LL | x: Bar<'a>, | ---------- recursive without indirection | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Bar` representable error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0072`.