New enum layout optimizations in the latest Rust Nightly!
bool - Option<bool> is 1 byte
char - Option<char> is 4 bytes
enum - Option<Ordering> and Option<Option<bool>> are 1 byte
! ("Never") - Option<!> = (); Result<T, !> = T
great work, @eddyb_r!
-
-
Sometimes a smaller size is faster, even with an allocation. We shall see!
-
The important difference is that the size of each variant is not visible, so if you just said “box variants over size N” it wouldn’t be obvious what that does
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.