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.
This commit is contained in:
Philipp Hansch 2020-04-12 09:45:08 +02:00
parent 9682f0e14d
commit ec4f7e2edf
No known key found for this signature in database
GPG key ID: 2B4399C4BF4DCBDE

View file

@ -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;