#RustQuiz: what will be the output?

A. false
B. true
C. Compilation error
D. unsafe block is missing

#rustlang #rust

@AstraKernel Ohhh, that's a tricky one. I honestly have no clue. I am even unsure if debug and release will yield the same result here.
@AstraKernel That said: I think the result is true. I don't know the actual reasoning behind this, but if I remember correctly, Rust does not create an actual in-memory representation of instances of types with cardinality 1, as those would all be identical anyhow...
One consequence - again iirc - is that all instances of a type with cardinality 1 have the same address.
@soulsource @AstraKernel
I'm a little unsure if there's actually a guarantee that taking two references to the same ZST will return the same pointer.

@hjvt @AstraKernel Interesting. I had it somehow stuck in my mind that this is defined, and getting the address always yields the same value (at least for the same type).

However, doing a quick web search yields no mention of this, so I probably misremembered.