On replacing UnsafeCell
ProgramCrafter:
I continue to hold that
UnsafeCell<T>is some strange "type" because it doesn't do anything in its owned form, and is rather pointless to pass through function boundaries in any form.
It does something in its shared form though. Types in Rust have two faces that are both equally relevant. It seems odd to me to discard a type just because it is transparent for one of those two faces, when it is clearly very relevant for the other face.
Also FWIW every time we did this with attributes it was a mistake. In particular #[packed] is a terrible hack and was unsound for many years. Generally this kind of semantic change is much easier to get right in the language, and much easier to communicate to users, when it is done with types rather than attributes.
Discussion in the ATmosphere