I am wondering what is allowed in terms of aliasing and mutation when having pointers and references to the same value in Rust. I already looked inside the book1, the nomicon2 and the documentation of std::ptr3.
My current understanding is as follows: Pointers do not play into the aliasing guarantees made for references so that there can be an unbounded number of pointers to any reference. Pointers can always read, they can only write if no reference to their pointee exists. References work as normal, it is the users responsibility to anticipate that while using pointers.
After reading the following two sentences from the safety documentation from std::ptr3 I am confused though:
The result of casting a reference to a pointer is valid for as long as the underlying object is live and no reference (just raw pointers) is used to access the same memory. That is, reference and pointer accesses cannot be interleaved.
Since reads are also accesses as far as I know I interpret this text as saying it is not even allowed to read alternating from a pointer and a reference even if the value stays constant. Is that correct?
The Dark Arts of Advanced and Unsafe Rust Programming
Manually manage memory through raw pointers.