I want to emphasize here that an uninhabited type isn't quite a zero sized type; it's generally fine to treat them as such, but ideally size_of() would be returning that it has no size at all, not even a size of 0. There's a related situation with dynamically sized types like dyn Foo and [Bar] (without a wrapping reference) - it's not documented, but IIRC size_of() panics for those as 0 is not a reasonable fallback? Logically, it should probably return an enum itself!