// Recursive type using boxes enum List { Cons(i32, Box), Nil, } fn main() { // Storing `i32` value on heap let b = Box::new(5); println!("b = {}", b); use crate::List::{Cons, Nil}; let list = Cons(1, Box::new(Cons(2, Box::new(Cons(3, Box::new(Nil)))))); }