It turns out Rust also implements a "null pointer optimization" which allows it to represent an of pointer types exactly like you would in C++-as a simple pointer, but with the benefit that the programmer is forced to check it properly. It doesn't even stop there! Other types with "invalid" encodings can be optimized down to smaller representations, too.