|
|
|
|
|
by TheZenPsycho
4685 days ago
|
|
just offhand, from my understanding, ~ signifies rust's pointer type. It's different from C's pointer type in subtle ways, so the symbol is different, to force reader to actually look into it, and understand what it does different instead of just assuming it's just like C's. There's also the advantage that there's no way to conflict with the * multiplication operator. |
|
~ is an owned pointer (like unique_ptr in C++); & is a "reference" or borrowed pointer (allowing access to data without taking ownership); * is a raw/unsafe pointer, and is identical to C's pointers.
Also, the * pointer doesn't conflict with multiplication because they can never occur in an ambiguous context: