Skip to content

Commit 86cc93e

Browse files
committed
Document awkward names
1 parent d8c6e19 commit 86cc93e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/dev/style.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,18 @@ Default names:
403403
* `n_foo` -- number of foos
404404
* `foo_idx` -- index of `foo`
405405

406+
Many names in rust-analyzer conflict with keywords.
407+
We use mangled names instead of `r#ident` syntax:
408+
409+
```
410+
struct -> strukt
411+
crate -> krate
412+
impl -> imp
413+
trait -> trait_
414+
fn -> func
415+
enum -> enum_
416+
mod -> module
417+
```
406418

407419
## Early Returns
408420

0 commit comments

Comments
 (0)