9 ms·
I feel that way about the disclaimer on the homepage, but the transmuting to &mut disclaimer is literally true. Apologies if you're already familiar with this:
by iudqnolq 6y ago
I feel that way about the disclaimer on the homepage, but the transmuting to &mut disclaimer is literally true.
Apologies if you're already familiar with this: It doesn't mean it's not sometimes necessary to have two `*mut T` to the same location, it's that the compiler makes specific assumptions about `&mut T` such that two &mut to the same location existing, even if never used, is UB. To work around this you need to stay in raw pointer land and use APIs like ptr::write.