summaryrefslogtreecommitdiffstats
path: root/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr
blob: 80a494f3f65eb20d83ecf57aa34b381a456f5ed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
error[E0072]: recursive type `A` has infinite size
  --> $DIR/mutual-struct-recursion.rs:1:1
   |
LL | struct A<T> {
   | ^^^^^^^^^^^ recursive type has infinite size
...
LL |     y: B<T>,
   |        ---- recursive without indirection
   |
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `A` representable
   |
LL |     y: Box<B<T>>,
   |        ++++    +

error[E0072]: recursive type `B` has infinite size
  --> $DIR/mutual-struct-recursion.rs:7:1
   |
LL | struct B<T> {
   | ^^^^^^^^^^^ recursive type has infinite size
LL |
LL |     z: A<T>
   |        ---- recursive without indirection
   |
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `B` representable
   |
LL |     z: Box<A<T>>
   |        ++++    +

error[E0072]: recursive type `C` has infinite size
  --> $DIR/mutual-struct-recursion.rs:12:1
   |
LL | struct C<T> {
   | ^^^^^^^^^^^ recursive type has infinite size
...
LL |     y: Option<Option<D<T>>>,
   |        -------------------- recursive without indirection
   |
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `C` representable
   |
LL |     y: Option<Box<Option<D<T>>>>,
   |               ++++            +

error[E0072]: recursive type `D` has infinite size
  --> $DIR/mutual-struct-recursion.rs:18:1
   |
LL | struct D<T> {
   | ^^^^^^^^^^^ recursive type has infinite size
LL |
LL |     z: Option<Option<C<T>>>,
   |        -------------------- recursive without indirection
   |
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `D` representable
   |
LL |     z: Option<Box<Option<C<T>>>>,
   |               ++++            +

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0072`.