style-guide: Clarify advice on names matching keywords

In particular, specify what this advice is an alternative to (creative
misspellings such as `krate`).
This commit is contained in:
Josh Triplett 2023-06-22 13:21:40 -07:00
parent 6f8f83f66d
commit fec28b26b5

View File

@ -25,9 +25,9 @@ if y {
* Local variables shall be `snake_case`,
* Macro names shall be `snake_case`,
* Constants (`const`s and immutable `static`s) shall be `SCREAMING_SNAKE_CASE`.
* When a name is forbidden because it is a reserved word (e.g., `crate`), use a
trailing underscore to make the name legal (e.g., `crate_`), or use raw
identifiers if possible.
* When a name is forbidden because it is a reserved word (such as `crate`),
either use a raw identifier (`r#crate`) or use a trailing underscore
(`crate_`). Don't misspell the word (`krate`).
### Modules