@@ -11,7 +11,7 @@ rustc is slowly moving towards the [Rust standard coding style][fmt];
1111at the moment, however, it follows a rather more * chaotic* style. We
1212do have some mandatory formatting conventions, which are automatically
1313enforced 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
1515in isolation with ` ./x.py test src/tools/tidy ` .
1616
1717[ fmt ] : https://github.com/rust-lang-nursery/fmt-rfcs
@@ -20,11 +20,12 @@ in isolation with `./x.py test src/tools/tidy`.
2020
2121### Copyright notice
2222
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.
2829
2930## Line length
3031
@@ -132,3 +133,18 @@ require that every intermediate commit successfully builds – we only
132133expect to be able to bisect at a PR level. However, if you * can* make
133134individual commits build, that is always helpful.
134135
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