@@ -11,7 +11,7 @@ rustc is slowly moving towards the [Rust standard coding style][fmt];
11
11
at the moment, however, it follows a rather more * chaotic* style. We
12
12
do have some mandatory formatting conventions, which are automatically
13
13
enforced by a script we affectionately call the "tidy" script. The
14
- tidy script runs automatically when you do ` ./x.py test ` and can be run
14
+ tidy script runs automatically when you do ` ./x.py test ` and can be run
15
15
in isolation with ` ./x.py test src/tools/tidy ` .
16
16
17
17
[ fmt ] : https://github.com/rust-lang-nursery/fmt-rfcs
@@ -20,11 +20,12 @@ in isolation with `./x.py test src/tools/tidy`.
20
20
21
21
### Copyright notice
22
22
23
- Some existing files begin with a copyright and license notice. Please omit this
24
- notice for new files licensed under the standard terms (dual MIT/Apache-2.0).
25
- For existing files, the year at the top is not meaningful: copyright
26
- protections are in fact automatic from the moment of authorship. We do not
27
- typically edit the years on existing files.
23
+ In the past, files begin with a copyright and license notice. Please ** omit**
24
+ this notice for new files licensed under the standard terms (dual
25
+ MIT/Apache-2.0).
26
+
27
+ All of the copyright notices should be gone by now, but if you come across one
28
+ in the rust-lang/rust repo, feel free to open a PR to remove it.
28
29
29
30
## Line length
30
31
@@ -132,3 +133,18 @@ require that every intermediate commit successfully builds – we only
132
133
expect to be able to bisect at a PR level. However, if you * can* make
133
134
individual commits build, that is always helpful.
134
135
136
+ # Naming conventions
137
+
138
+ Apart from normal Rust style/naming conventions, there are also some specific
139
+ to the compiler.
140
+
141
+ - ` cx ` tends to be short for "context" and is often used as a suffix. For
142
+ example, ` tcx ` is a common name for the [ Typing Context] [ tcx ] .
143
+
144
+ - [ ` 'tcx ` and ` 'gcx ` ] [ tcx ] are used as the lifetime names for the Typing
145
+ Context.
146
+
147
+ - Because ` crate ` is a keyword, if you need a variable to represent something
148
+ crate-related, often the spelling is changed to ` krate ` .
149
+
150
+ [ tcx ] : ./ty.md
0 commit comments