@@ -199,25 +199,121 @@ TODO: talk about things like miri, clippy, chalk, etc
199
199
There are some official procedures to know about. This is a tour of the
200
200
highlights, but there are a lot more details, which we will link to below.
201
201
202
- ### Bug Fixes
202
+ ### Code Review
203
203
204
- TODO: talk about bors, highfive
204
+ When you open a PR on the ` rust-lang/rust ` repo, a bot called ` @highfive ` will
205
+ automatically assign a reviewer to the PR. The reviewer is the person that will
206
+ approve the PR to be tested and merged. If you want a specific reviewer (e.g. a
207
+ team member you've been working with), you can specifically request them by
208
+ writing ` r? @user ` (e.g. ` r? @eddyb ` ) in either the original post or a followup
209
+ comment.
210
+
211
+ The reviewer may request some changes using the GitHub code review interface.
212
+ They may also request special procedures (such as a crater run; see below) for
213
+ some PRs.
214
+
215
+ When the PR is ready to be merged, the reviewer will issue a command to
216
+ ` @bors ` , the CI bot. Usually, this is ` @bors r+ ` or ` @bors r=@user ` to approve
217
+ a PR (there are few other commands, but they are less relevant here). This puts
218
+ the PR in [ bors's queue] [ bors ] to be tested and merged. Be patient; this can take a
219
+ while and the queue can sometimes be long. PRs are never merged by hand.
220
+
221
+ [ bors ] : https://buildbot2.rust-lang.org/homu/queue/rust
222
+
223
+ ### Bug Fixes or "Normal" code changes
224
+
225
+ For most PRs, no special procedures are needed. You can just open a PR, and it
226
+ will be reviewed, approved, and merged. This includes most bug fixes,
227
+ refactorings, and other user-invisible changes. The next few sections talk
228
+ about exceptions to this rule.
205
229
206
230
### New Features
207
231
208
- TODO: talk about RFCs, stabilization
232
+ Rust has strong backwards-compatibility guarantees. Thus, new features can't
233
+ just be implemented directly in stable Rust. Instead, we have 3 release
234
+ channels: stable, beta, and nightly.
235
+
236
+ - ** Stable** : this is the latest stable release for general usage.
237
+ - ** Beta** : this is the next release (will be stable within 6 weeks).
238
+ - ** Nightly** : follows the ` master ` branch of the repo. This is the only
239
+ channel where unstable, incomplete, or experimental features are usable with
240
+ feature gates.
241
+
242
+ In order to implement a new feature, usually you will need to go through [ the
243
+ RFC process] [ rfc ] to propose a design, have discussions, etc. In some cases,
244
+ small features can be added with only an FCP (see below). If in doubt, ask the
245
+ compiler, language, or libs team (whichever is most relevant).
246
+
247
+ [ rfc ] : https://github.com/rust-lang/rfcs/blob/master/README.md
248
+
249
+ After a feature is approved to be added, a tracking issue is created on the
250
+ ` rust-lang/rust ` repo, which tracks the progress towards the implementation of
251
+ the feature, any bugs reported, and eventually stabilization.
252
+
253
+ The feature then needs to be implemented behind a feature gate, which prevents
254
+ it from being accidentally used.
255
+
256
+ Finally, somebody may propose stabilizing the feature in an upcoming version of
257
+ Rust. This requires an FCP (see below) to get the approval of the relevant teams.
258
+
259
+ After that, the feature gate can be removed and the feature turned on for all users.
260
+
261
+ [ For more details on this process, see this chapter.] ( ./implementing_new_features.md )
209
262
210
263
### Breaking Changes
211
264
212
- TODO: talk about crater, FCP, etc
265
+ As mentioned above, Rust has strong backwards-compatibility guarantees. To this
266
+ end, we are reluctant to make breaking changes. However, sometimes they are
267
+ needed to correct compiler bugs (e.g. code that compiled but should not).
268
+
269
+ Depending on the scale of the breakage, there are a few different actions that
270
+ can be taken. If the reviewer believes the breakage is very minimal (i.e. very
271
+ unlikely to be actually encountered by users), they may just merge the change.
272
+ More often, they will request a Final Comment Period (FCP), which calls for
273
+ rough consensus among the members of a relevant team. The team members can
274
+ discuss the issue and either accept, reject, or request changes on the PR.
275
+
276
+ If the scale of breakage is large, a deprecation warning may be needed. This is
277
+ a warning that the compiler will display to users whose code will break in the
278
+ future. After some time, an FCP can be used to move forward with the actual
279
+ breakage.
280
+
281
+ If the scale of breakage is unknown, a team member or contributor may request a
282
+ [ crater] run. This is a bot that will compile all crates.io crates and many
283
+ public github repos with the compiler with your changes. A report will then be
284
+ generated with crates that ceased to compile with or began to compile with your
285
+ changes. Crater runs can take a few days to complete.
286
+
287
+ [ crater ] : https://github.com/rust-lang/crater
213
288
214
289
### Major Changes
215
290
216
- TODO: talk about MCP
291
+ The compiler team has a special process for large changes, whether or not they
292
+ cause breakage. This process is call Major Change Proposal (MCP). MCP is a
293
+ relatively lightweight mechanism for getting feedback on large changes to the
294
+ compiler (as opposed to a full RFC or a design meeting with the team).
295
+
296
+ Example of things that might require MCPs include major refactorings, changes
297
+ to important types, or important changes to how the compiler does something.
298
+
299
+ ** When in doubt, ask on [ zulip] [ z ] . We would hate for you to put a lot of work
300
+ into a PR that ends up not getting merged!**
217
301
218
302
### Performance
219
303
220
- TODO: Talk about perf runs
304
+ Compiler performance is important. We have put a lot of effort over the last
305
+ few years into [ gradually improving it] [ perfdash ] .
306
+
307
+ [ perfdash ] : https://perf.rust-lang.org/dashboard.html
308
+
309
+ If you suspect that your change may cause a performance regression (or
310
+ improvement), you can request a "perf run" (your reviewer may also request one
311
+ before approving). This is yet another bot that will compile a collection of
312
+ benchmarks on a compiler with your changes. The numbers are reported
313
+ [ here] [ perf ] , and you can see a comparison of your changes against the latest
314
+ master.
315
+
316
+ [ perf ] : https://perf.rust-lang.org/dashboard.html
221
317
222
318
## Other Resources
223
319
0 commit comments