3 ms·
I don't think we actually defined the addresses of zero-sized values to be equal; I believe it's actually unspecified. I don't think this has ever come up in pr
by pcwalton 12y ago
I don't think we actually defined the addresses of zero-sized values to be equal; I believe it's actually unspecified. I don't think this has ever come up in practice, though; we could define them to be equal if we wanted to.
That issue hasn't come up in Rust, probably because equality and hashing look through references (per the definitions of Hash and Eq in the standard library), so you'd really have to go out of your way to try to use unit as a way to make package-specific keys like that.