diff options
| author | Philipp Hansch <dev@phansch.net> | 2020-04-12 09:45:08 +0200 |
|---|---|---|
| committer | Philipp Hansch <dev@phansch.net> | 2020-04-12 11:24:58 +0200 |
| commit | ec4f7e2edfa8ee6cf9933ceb9194db44158e9222 (patch) | |
| tree | 8e166e0e1cbee6dbc12776e54e5da36f8d69d00e | |
| parent | 9682f0e14db95076454559a24c26287bcad57955 (diff) | |
| download | rust-ec4f7e2edfa8ee6cf9933ceb9194db44158e9222.tar.gz rust-ec4f7e2edfa8ee6cf9933ceb9194db44158e9222.zip | |
Add some basic docs to `sym` and `kw` modules
I was looking into improving some Clippy documentation but was missing a place that explains the `kw` and `sym` modules from rustc.
| -rw-r--r-- | src/librustc_span/symbol.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustc_span/symbol.rs b/src/librustc_span/symbol.rs index 6845cb3b9a3..4c963ac84dc 100644 --- a/src/librustc_span/symbol.rs +++ b/src/librustc_span/symbol.rs @@ -1153,12 +1153,20 @@ impl Interner { } // This module has a very short name because it's used a lot. +/// This module contains all the defined keyword `Symbol`s. +/// +/// Given that `kw` is imported, use them like `kw::keyword_name`. +/// For example `kw::Loop` or `kw::Break`. pub mod kw { use super::Symbol; keywords!(); } // This module has a very short name because it's used a lot. +/// This module contains all the defined non-keyword `Symbol`s. +/// +/// Given that `sym` is imported, use them like `sym::symbol_name`. +/// For example `sym::rustfmt` or `sym::u8`. #[allow(rustc::default_hash_types)] pub mod sym { use super::Symbol; |
