Comment

Comment by tialaramex

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.
parent tialaramex 1 month ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton