A reference IS Copy, by the simple fact that it is a primitive value on the stack.
This seems a bit misleading, noting that unique/mutable references aren't Copy
. Shared references are Copy
because it's sound to have that, and it's a huge QOL improvement over the alternative.
This parting shot sounds pretty dire
That's definitely not how it should be. Fortunately, I think I disagree with that, since miri points to the "real" buggy code:
unsafe { inner.as_ref() }
As opposed to the article, I'd argue this code is not correct, since it did not account for alignment, which it must (I mean, by standard use of the word
unsound
this is unsound, since it can be called from safe code introducing UB). Or am I wrong? Is the fundamental value proposition of rust moot?