Minor nit, since we no longer should need to use pointer arithmetics since the stabilization of ptr::addr_of_mut!.
The SAFETY documentation is a bit odd, since it previously didn't motivate why accessing the field through UnsafeCell was OK. However, I'm not sure UnsafeCell<T> is even necessary any longer with addr_of* since we avoid intermediate references directly over self. Nevermind! Just needed a refresher.
Minor nit, since we no longer should need to use pointer arithmetics since the stabilization of
ptr::addr_of_mut!
.The SAFETY documentation is a bit odd, since it previously didn't motivate why accessing the field through
UnsafeCell
was OK. However,I'm not sure. Nevermind! Just needed a refresher.UnsafeCell<T>
is even necessary any longer withaddr_of*
since we avoid intermediate references directly overself