|
| 1 | +error[E0072]: recursive type `A` has infinite size |
| 2 | + --> $DIR/mutual-struct-recursion.rs:1:1 |
| 3 | + | |
| 4 | +LL | struct A<T> { |
| 5 | + | ^^^^^^^^^^^ recursive type has infinite size |
| 6 | +... |
| 7 | +LL | y: B<T>, |
| 8 | + | ---- recursive without indirection |
| 9 | + | |
| 10 | +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `A` representable |
| 11 | + | |
| 12 | +LL | y: Box<B<T>>, |
| 13 | + | ^^^^ ^ |
| 14 | + |
| 15 | +error[E0072]: recursive type `B` has infinite size |
| 16 | + --> $DIR/mutual-struct-recursion.rs:7:1 |
| 17 | + | |
| 18 | +LL | struct B<T> { |
| 19 | + | ^^^^^^^^^^^ recursive type has infinite size |
| 20 | +LL | |
| 21 | +LL | z: A<T> |
| 22 | + | ---- recursive without indirection |
| 23 | + | |
| 24 | +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `B` representable |
| 25 | + | |
| 26 | +LL | z: Box<A<T>> |
| 27 | + | ^^^^ ^ |
| 28 | + |
| 29 | +error[E0072]: recursive type `C` has infinite size |
| 30 | + --> $DIR/mutual-struct-recursion.rs:12:1 |
| 31 | + | |
| 32 | +LL | struct C<T> { |
| 33 | + | ^^^^^^^^^^^ recursive type has infinite size |
| 34 | +... |
| 35 | +LL | y: Option<Option<D<T>>>, |
| 36 | + | -------------------- recursive without indirection |
| 37 | + | |
| 38 | +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `C` representable |
| 39 | + | |
| 40 | +LL | y: Box<Option<Option<D<T>>>>, |
| 41 | + | ^^^^ ^ |
| 42 | + |
| 43 | +error[E0072]: recursive type `D` has infinite size |
| 44 | + --> $DIR/mutual-struct-recursion.rs:18:1 |
| 45 | + | |
| 46 | +LL | struct D<T> { |
| 47 | + | ^^^^^^^^^^^ recursive type has infinite size |
| 48 | +LL | |
| 49 | +LL | z: Option<Option<C<T>>>, |
| 50 | + | -------------------- recursive without indirection |
| 51 | + | |
| 52 | +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `D` representable |
| 53 | + | |
| 54 | +LL | z: Box<Option<Option<C<T>>>>, |
| 55 | + | ^^^^ ^ |
| 56 | + |
| 57 | +error: aborting due to 4 previous errors |
| 58 | + |
| 59 | +For more information about this error, try `rustc --explain E0072`. |
0 commit comments