In Rust, pointers can never be null, so in case where you actually need null, such as a linked list, you use the Option type:

struct element {
value: int,
next: Option<~element>,
}

How much overhead is involved in this (in terms of memory allocation and steps to dereference compared to a simple pointer)? Is there some "magic" in the compiler/runtime to make Option cost-free, or less costly than if one were to implement Option by oneself in a non-core library (using the same enum construct, or by wrapping the pointer in a vector)?

I'm a bit hesitant to commit to a particular bit representation of
enums, since there's lots of room for compiler optimization here. For
example, we might want to collapse Option<~int> into a nullable
pointer, we might want to collapse Result<(),~str> into a nullable
string, or we might want to collapse Either<u8,~str> into 1 word,
assuming that strings can never occupy the top 256 bytes of the
address space. I've thought for a while that perhaps it's best to
just say that the bit pattern of Rust enums is unspecified, to give
us as much room as possible to play with optimizations.