Skip to content

Commit 0e47d69

Browse files
authored
Rollup merge of rust-lang#71053 - phansch:update_kw_sym_docs, r=Dylan-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.
2 parents 9c34740 + ec4f7e2 commit 0e47d69

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustc_span/symbol.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1153,12 +1153,20 @@ impl Interner {
11531153
}
11541154

11551155
// This module has a very short name because it's used a lot.
1156+
/// This module contains all the defined keyword `Symbol`s.
1157+
///
1158+
/// Given that `kw` is imported, use them like `kw::keyword_name`.
1159+
/// For example `kw::Loop` or `kw::Break`.
11561160
pub mod kw {
11571161
use super::Symbol;
11581162
keywords!();
11591163
}
11601164

11611165
// This module has a very short name because it's used a lot.
1166+
/// This module contains all the defined non-keyword `Symbol`s.
1167+
///
1168+
/// Given that `sym` is imported, use them like `sym::symbol_name`.
1169+
/// For example `sym::rustfmt` or `sym::u8`.
11621170
#[allow(rustc::default_hash_types)]
11631171
pub mod sym {
11641172
use super::Symbol;

0 commit comments

Comments
 (0)