doc: Boxes diagram shows enum value inside box.

This commit is contained in:
Div Shekhar 2014-01-15 07:36:20 -08:00
parent bf2ab22cd0
commit 065f936bf1

View File

@ -1020,10 +1020,10 @@ being destroyed along with the owner. Since the `list` variable above is
immutable, the whole list is immutable. The memory allocation itself is the
box, while the owner holds onto a pointer to it:
Cons cell Cons cell Cons cell
+-----------+ +-----+-----+ +-----+-----+
| 1 | ~ | -> | 2 | ~ | -> | 3 | ~ | -> Nil
+-----------+ +-----+-----+ +-----+-----+
List box List box List box List box
+--------------+ +--------------+ +--------------+ +--------------+
list -> | Cons | 1 | ~ | -> | Cons | 2 | ~ | -> | Cons | 3 | ~ | -> | Nil |
+--------------+ +--------------+ +--------------+ +--------------+
An owned box is a common example of a type with a destructor. The allocated
memory is cleaned up when the box is destroyed.