Add a note about scoping differences between `*x` and `*x.deref()` as well as `a[b]` and `*a.index(b)`
The section on * operators states that an overloaded *x is equivalent in immutable place expression contexts to *std::ops::Deref::deref(&x) and that it is equivalent in mutable place expression contexts to *std::ops::DerefMut::deref_mut(&mut x). That isn't quite true for their temporary scopes, so this PR adds a note including an example where the difference affects static semantics.
There's a similar section for index expressions defining a[b] in terms of associated function calls, so I've added a comparable example for temporary scoping differences there as well.
The sections on field access expressions and tuple indexing expressions may also benefit from similar examples or links to that example, in case it needs clarifying that the way they autoderef is scoped more like repeatedly applying * than repeatedly applying a deref method. The autoderef section on the field access expressions page is in line with that, but doesn't clarify. The tuple indexing expressions section doesn't account for autoderef at all, so it would need to be reworked first.
@rustbot author
Looking at this again, it should probably be framed in terms of static semantics rather than runtime semantics, since one of the examples makes an unusable binding. I'll split that part off into a compile_fail test and remove the assertions.
While I'm at it, the wording of the * operator section should probably account for Box. It's covered in lang.types.box.deref; I'll add a reference to that.
Reminder, once the PR becomes ready for a review, use @rustbot ready.
@rustbot ready
I'll open a separate PR to add text for Box to the * operator expression documentation.