3 ms·
> Note that this is distinct from "auto-deref" (or deref coercion), another Rust feature that will automatically dereference pointers as necessary in certain ca
by saghm 8y ago
> Note that this is distinct from "auto-deref" (or deref coercion), another Rust feature that will automatically dereference pointers as necessary in certain cases, like calling a method on a struct (so there is no arrow operator "->" in Rust like in C++).
Is this actually distinct? The docs for the reference type explicitly says that &T implements Deref for T, so it seems like it's the exact same thing to me.
See https://doc.rust-lang.org/std/primitive.reference.html https://doc.rust-lang.org/std/primitive.reference.html
- steveklabnik 8y ago> Is this actually distinct? One is "overload star", the other is "automatically insert & and star", if I'm understanding the distinction that your parent is making.