3 ms·
I only meant "not a raw pointer" because rust supports read and write operations on raw pointers with very different aliasing semantics. It is an owned pointer
by ComputerGuru 2y ago
I only meant "not a raw pointer" because rust supports read and write operations on raw pointers with very different aliasing semantics.
It is an owned pointer, with emphasis on the "owned". You can have as many raw pointers to the same memory location as you like, you just can't have multiple native rust objects pointing to that same memory alive at once, though. It's also obvious because Box<T> implements Drop, so obviously it's not just something you can pass to a function in lieu of a pointer and if you do pass it to a function, you can no longer make any assumptions about the lifetime or validity of any pointers to the same data.