@lizardsquid@catoutofbed@iliana It's Option<&T> that compiles to a single pointer, as does any similar enum wrapped around any NonZero type. In general, Option<T> can't necessarily avoid having a separate tag field.
I think Result<T,E> should have the same size as Option<T> any time T is at least as big as E, including when E is zero-size. I believe there are special cases though, like that Result<T,!> has the same representation as T because the type proves the Err case can't happen.
@lizardsquid @catoutofbed @iliana It's Option<&T> that compiles to a single pointer, as does any similar enum wrapped around any NonZero type. In general, Option<T> can't necessarily avoid having a separate tag field.
I think Result<T,E> should have the same size as Option<T> any time T is at least as big as E, including when E is zero-size. I believe there are special cases though, like that Result<T,!> has the same representation as T because the type proves the Err case can't happen.