Re:Announcing Rust 1.20
by kevincox on Friday September 01, 2017 @03:41AM
(#15146826)
Yes. This optimization is expected to be expanded in the future but there are currently "NonZero" types. Rust notices this and uses the zero value as the enum descriminant.
So in this case the code generated is idential to a nullable pointer.
So in this case the code generated is idential to a nullable pointer.