Document trailing `self` in paths

The Reference says that `self` can only appear as the first segment of
a path.  Further, the `use` chapter describes `{self}` brace syntax as
the way to bind the parent entity of a `use` path under its own name.

In rust-lang/rust#155137, we're relaxing these restrictions: `self`
may now also appear as the last segment of a path (preceded by `::`)
as long as the preceding path resolves to a module, enumeration,
or trait.  In a `use` path, `use P::self [as name]` is equivalent
to `use P::{self [as name]}`.  In non-`use` paths, forms such as
`type Ty = P::self` and `pub(in P::self)` are now accepted.

Let's update the Reference to reflect this.
2 files changed
tree: 7cd187080a7ec99b43df911e8352d0b159e3c219
  1. .cargo/
  2. .github/
  3. dev-guide/
  4. docs/
  5. src/
  6. theme/
  7. tools/
  8. .gitattributes
  9. .gitignore
  10. book.toml
  11. Cargo.lock
  12. Cargo.toml
  13. CONTRIBUTING.md
  14. LICENSE-APACHE
  15. LICENSE-MIT
  16. README.md
  17. reference.md
  18. rust-toolchain.toml
  19. rustfmt.toml
  20. triagebot.toml
README.md

The Rust Language Reference

This document is the primary reference for the Rust programming language.

Contributor docs

See the Reference Developer Guide for information on contributing to the Reference.