diff options
Diffstat (limited to 'docs/dev/README.md')
-rw-r--r-- | docs/dev/README.md | 8 |
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 | ||
180 | It also makes sense to format snippets more compactly (for example, by placing enum defitions like `enum E { Foo, Bar }` on a single line), | ||
181 | as long as they are still readable. | ||
182 | |||
180 | ## Order of Imports | 183 | ## Order of Imports |
181 | 184 | ||
182 | We separate import groups with blank lines | 185 | We separate import groups with blank lines |
@@ -254,6 +257,11 @@ The default name is a lowercased name of the type: `global_state: GlobalState`. | |||
254 | Avoid ad-hoc acronyms and contractions, but use the ones that exist consistently (`db`, `ctx`, `acc`). | 257 | Avoid ad-hoc acronyms and contractions, but use the ones that exist consistently (`db`, `ctx`, `acc`). |
255 | The default name for "result of the function" local variable is `res`. | 258 | The default name for "result of the function" local variable is `res`. |
256 | 259 | ||
260 | ## Collection types | ||
261 | |||
262 | We prefer `rustc_hash::FxHashMap` and `rustc_hash::FxHashSet` instead of the ones in `std::collections`. | ||
263 | They 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 | ||
259 | Function preconditions should generally be expressed in types and provided by the caller (rather than checked by callee): | 267 | Function preconditions should generally be expressed in types and provided by the caller (rather than checked by callee): |