Manual Memory

Types need to have known size

enum List<T> {
  Nil,
  Cons(T, Box<List<T>>),
}

fn main() {}
  • Box is a heap pointer 1
  • Box pointer is never null
  • Box pointer gets deallocated when the handle goes out of scope

Other kinds of managed pointers 1