]> git.proxmox.com Git - rustc.git/blob - tests/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / structs-enums / struct-rec / mutual-struct-recursion.stderr
1 error[E0072]: recursive types `A` and `B` have infinite size
2 --> $DIR/mutual-struct-recursion.rs:1:1
3 |
4 LL | struct A<T> {
5 | ^^^^^^^^^^^
6 ...
7 LL | y: B<T>,
8 | ---- recursive without indirection
9 ...
10 LL | struct B<T> {
11 | ^^^^^^^^^^^
12 LL | z: A<T>
13 | ---- recursive without indirection
14 |
15 help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
16 |
17 LL ~ y: Box<B<T>>,
18 LL | }
19 LL |
20 LL | struct B<T> {
21 LL ~ z: Box<A<T>>
22 |
23
24 error[E0072]: recursive types `C` and `D` have infinite size
25 --> $DIR/mutual-struct-recursion.rs:11:1
26 |
27 LL | struct C<T> {
28 | ^^^^^^^^^^^
29 ...
30 LL | y: Option<Option<D<T>>>,
31 | ---- recursive without indirection
32 ...
33 LL | struct D<T> {
34 | ^^^^^^^^^^^
35 LL | z: Option<Option<C<T>>>,
36 | ---- recursive without indirection
37 |
38 help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
39 |
40 LL ~ y: Option<Option<Box<D<T>>>>,
41 LL | }
42 LL |
43 LL | struct D<T> {
44 LL ~ z: Option<Option<Box<C<T>>>>,
45 |
46
47 error: aborting due to 2 previous errors
48
49 For more information about this error, try `rustc --explain E0072`.