Re:Rust's unsafe pointer types need an overhaul
by heinrich5991 on Sunday March 20, 2022 @09:50AM
(#30742572)
`.` only produces a reference if you explicitly reference the result.
`a.b` is of type `B`, only `&a.b` is `&B` and `&mut a.b` is `&mut B`. This is unlike your proposal of `->` where `a->b` would be `*const B`.
Explaining it is simple:
‘.’ uses a reference and produces a reference
‘->’ uses a pointer and produces a pointer