Here is a formal aliasing model question. It seems like this should be easy - I'm pretty sure the answer is guaranteed to be yes on TB, though it is currently no on SB.
Basically, if you have an outstanding mutable reference to some memory region, then use &raw mut $path to get a raw pointer to the same memory, but do not dereference it (for example, calling .addr() on the pointer), does this invalidate the outstanding mutable reference?
I'm using this currently as a form of thread id on a thread_local value, while initializing the same value.
Here is a formal aliasing model question. It seems like this should be easy - I'm pretty sure the answer is guaranteed to be yes on TB, though it is currently no on SB.
Basically, if you have an outstanding mutable reference to some memory region, then use
&raw mut $pathto get a raw pointer to the same memory, but do not dereference it (for example, calling.addr()on the pointer), does this invalidate the outstanding mutable reference?I'm using this currently as a form of thread id on a
thread_localvalue, while initializing the same value.