aboutsummaryrefslogtreecommitdiff
path: root/docs/dev
diff options
context:
space:
mode:
Diffstat (limited to 'docs/dev')
-rw-r--r--docs/dev/README.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/dev/README.md b/docs/dev/README.md
index 11dc5261b..f1139d2f4 100644
--- a/docs/dev/README.md
+++ b/docs/dev/README.md
@@ -177,6 +177,9 @@ There are many benefits to this:
177* less stuff printed during printf-debugging 177* less stuff printed during printf-debugging
178* less time to run test 178* less time to run test
179 179
180It also makes sense to format snippets more compactly (for example, by placing enum defitions like `enum E { Foo, Bar }` on a single line),
181as long as they are still readable.
182
180## Order of Imports 183## Order of Imports
181 184
182We separate import groups with blank lines 185We separate import groups with blank lines
@@ -254,6 +257,11 @@ The default name is a lowercased name of the type: `global_state: GlobalState`.
254Avoid ad-hoc acronyms and contractions, but use the ones that exist consistently (`db`, `ctx`, `acc`). 257Avoid ad-hoc acronyms and contractions, but use the ones that exist consistently (`db`, `ctx`, `acc`).
255The default name for "result of the function" local variable is `res`. 258The default name for "result of the function" local variable is `res`.
256 259
260## Collection types
261
262We prefer `rustc_hash::FxHashMap` and `rustc_hash::FxHashSet` instead of the ones in `std::collections`.
263They use a hasher that's slightly faster and using them consistently will reduce code size by some small amount.
264
257## Preconditions 265## Preconditions
258 266
259Function preconditions should generally be expressed in types and provided by the caller (rather than checked by callee): 267Function preconditions should generally be expressed in types and provided by the caller (rather than checked by callee):