4 ms·
You can point to the element one pass, but you cannot dereference the pointer.
by pix64 5y ago
You can point to the element one pass, but you cannot dereference the pointer.
- SV_BubbleTime 5y agoAh, I get it now. And it’s interesting to me that Rust doesn’t allow that considering it’s not accessing memory (yet, and that’s the whole point I’m sure.
- Diggsey 5y agoPointers in Rust behave the same way. The problem is that the "array index" operator in Rust returns a reference to the indexed element, not a pointer, and references must be safely dereferenceable.