Skip to content

Commit

Permalink
Rollup merge of rust-lang#71053 - phansch:update_kw_sym_docs, r=Dylan…
Browse files Browse the repository at this point in the history
…-DPC

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 adds some very basic usage documentation to these modules.
  • Loading branch information
Dylan-DPC authored Apr 12, 2020
2 parents 9c34740 + ec4f7e2 commit 0e47d69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/librustc_span/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0e47d69

Please sign in to comment.