]>
Commit | Line | Data |
---|---|---|
74b04a01 XL |
1 | $ cargo run |
2 | Compiling cons-list v0.1.0 (file:///projects/cons-list) | |
3 | error[E0072]: recursive type `List` has infinite size | |
4 | --> src/main.rs:1:1 | |
5 | | | |
6 | 1 | enum List { | |
7 | | ^^^^^^^^^ recursive type has infinite size | |
8 | 2 | Cons(i32, List), | |
9 | | ---- recursive without indirection | |
10 | | | |
fc512014 XL |
11 | help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `List` representable |
12 | | | |
13 | 2 | Cons(i32, Box<List>), | |
a2a8927a | 14 | | ++++ + |
74b04a01 | 15 | |
487cf647 FG |
16 | For more information about this error, try `rustc --explain E0072`. |
17 | error: could not compile `cons-list` due to previous error |