]> git.lizzy.rs Git - rust.git/commitdiff
Document awkward names
authorAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 15 Oct 2020 16:14:30 +0000 (18:14 +0200)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 15 Oct 2020 16:14:30 +0000 (18:14 +0200)
docs/dev/style.md

index 20f1b6253e7fba40d3d85a57718e4b884e97629c..883a6845d91189bd5d3ece691b22e19db4b39917 100644 (file)
@@ -403,6 +403,18 @@ Default names:
 * `n_foo` -- number of foos
 * `foo_idx` -- index of `foo`
 
+Many names in rust-analyzer conflict with keywords.
+We use mangled names instead of `r#ident` syntax:
+
+```
+struct -> strukt
+crate  -> krate
+impl   -> imp
+trait  -> trait_
+fn     -> func
+enum   -> enum_
+mod    -> module
+```
 
 ## Early Returns