summaryrefslogtreecommitdiffstats
path: root/src/doc/book/listings/ch15-smart-pointers/listing-15-03/output.txt
blob: 04b6976fedf819797ff8a3631d9655110a7515fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ cargo run
   Compiling cons-list v0.1.0 (file:///projects/cons-list)
error[E0072]: recursive type `List` has infinite size
 --> src/main.rs:1:1
  |
1 | enum List {
  | ^^^^^^^^^
2 |     Cons(i32, List),
  |               ---- recursive without indirection
  |
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
  |
2 |     Cons(i32, Box<List>),
  |               ++++    +

For more information about this error, try `rustc --explain E0072`.
error: could not compile `cons-list` due to previous error