Comment by tialaramex
4 hours ago
Which makes sense because you could (and indeed still will be able to do) write your own uninhabited types very easily in Rust and indeed they're optimised accordingly. Because Rust has user-defined sum types you could simply write a sum of nothing:
enum MyNeverType {}
...and it's uninhabited, the same way you can write the product of nothing
struct MyUnitType {}
... and its size is zero.
Note, to be more clear, an enum with no variants has no values of that type (can't be constructed), and a struct with no fields has exactly one value of that type