Remix.run Logo
Sytten 10 hours ago

Another one that is missing in the article is &raw mut/const but it is purely for unsafe usage when you need a pointer to an unaligned field of a struct.

steveklabnik 10 hours ago | parent [-]

&raw T/&raw mut T aren't pointer types, they're syntax for creating *const T/*mut T.

These aren't included in the article because they are not borrow checked, but you're right that if someone was trying to cover 100% of pointer types in Rust, raw pointers would be missing.

gpm 8 hours ago | parent [-]

If we start creating more `&... T` ptr types I wonder if a future edition changes `*const T` to `&raw T` for consistency...

kibwen 7 hours ago | parent | next [-]

I'm hoping that languages move away from the sigil-ified legacy of C treating pointers as special syntax and just start calling these `Ref<T>`, `PtrConst<T>`, etc.

steveklabnik 7 hours ago | parent | prev [-]

Ehhh it’s already consistent: ones with & borrow, ones without do not.