Closed
Description
Hi 🦀 ,
I'm a bit confused with the term "non-pointer types" used in the docs for Deref
/DerefMut
.
- From docs for
Deref
If T implements Deref<Target = U>, and x is a value of type T, then:
* In immutable contexts, *x on non-pointer types is equivalent to *Deref::deref(&x).
- From docs for
DerefMut
If T implements DerefMut<Target = U>, and x is a value of type T, then:
* In mutable contexts, *x on non-pointer types is equivalent to *DerefMut::deref_mut(&mut x).
The docs describe behavior of *x
on non-pointer types.
If I assume "smart pointer"s are "pointer"s (as the Rust reference does),
it seems quite awkward to discuss behavior of *x
on non-pointer types in the docs,
since docs for Deref
& DerefMut
say that
"Deref/DerefMut should only be implemented for smart pointers".
If the term "non-pointer type" refers to smart pointers in this context,
would it be better to replace the term "non-pointer type" with either
just "smart pointer" or "non-primitive pointer type" ??
Thank you for reading this issue 🦀