11Review Policy
22=============
33
4+ This document describes our review policy for contributions to the Rust
5+ compiler. Its intended audience are contributors and reviewers as well.
6+
7+ The purpose of this policy is to help contributors shape pull requests that
8+ are easier to review - by clarifying the Rust project expectations - and for
9+ reviewers as well - by having a handy list of common things to check. The
10+ project will benefit if both parties have clear how to work together.
11+
412It is the purpose of code reviews to:
513
614- ** Reduce** the risk of introducing ** bugs** and usability and performance
@@ -43,9 +51,10 @@ be effective:
4351 for answering this question.
4452 - Procedure wise, the reviewer also needs to decide:
4553 - Can the reviewer make the decision alone?
46- - Does the PR needs to go through the [ Major Change Process] [ mcp ] , or does
47- it need a T-compiler [ Final Comment Period] [ fcp ] sign-off, or does it need
48- a full [ Request For Comments (RFC)] [ rfc ] ?
54+ - Does the PR needs to go through the [ Major Change Process] [ MCP ] , or does
55+ it need a T-compiler Final Comment Period sign-off (a buffer of time to
56+ allow last comments or concerns before an official approval), or does it
57+ need a full [ Request For Comments (RFC)] [ rfc ] ?
4958 - Does the PR need reviews and/or sign-off from other teams, particularly
5059 T-lang?
5160 - Can the changes break stable code or begin accepting new code that we do
@@ -78,7 +87,7 @@ bring PRs into good shape and meet the above criteria:
7887> * ** Links to relevant issues** , RFCs, MCPs, etc?
7988> * Does the PR need a ** regression test** ? Does the PR have ** sufficient test
8089> coverage** ?
81- > * Does the change need to be covered by a ** [ major change proposal] [ mcp ] ** ? Is
90+ > * Does the change need to be covered by a ** major change proposal ( [ MCP ] ) ** ? Is
8291> it already covered? If there is already a MCP open, was it already accepted,
8392> or is the PR blocked on that?
8493> * Does the PR need a ** perf run** ?
@@ -146,7 +155,7 @@ depending on the concrete case:
146155 able to review it, or even if the team is comfortable with accepting the
147156 change at all.
148157- If the change is intended for another team, roll a reviewer from the relevant
149- team.
158+ team (example ` r? compiler ` )
150159
151160You can also always ask for help on the ` #t-compiler ` Zulip stream for finding a
152161reviewer. That being said, you are always welcome to do an initial review (to
@@ -157,7 +166,7 @@ understanding of diverse areas in the compiler.
157166
158167### It is unclear if something constitutes a major change
159168
160- Deciding if something is a "major change" requiring an [ MCP] [ mcp ] is not always
169+ Deciding if something is a "major change" requiring an [ MCP] is not always
161170straightforward. The official guidelines are [ here] [ whats-a-major-change ] . When
162171in doubt, err on side of treating something as a major change. You can also
163172nominate the PR for discussion in the compiler team's triage meeting by tagging
@@ -216,7 +225,7 @@ discussed and cleared up? Then you are in the clear.
216225If you are in doubt if something is contentious, give a heads up to
217226`@rust-lang/compiler` and ask for another opinion. If the proposed change is
218227large and/or potentially has a big impact, you can discuss in a `#t-compiler`
219- zulip topic, and/or create a [Major Change Proposal][mcp ].
228+ zulip topic, and/or create a [Major Change Proposal][MCP ].
220229
221230### Reviewing and Mentoring
222231
@@ -246,7 +255,7 @@ and blindspots a mentor might have.
246255Sometimes there is a bug in some code that nobody understands anymore. The
247256original authors are unavailable and it is hard to gauge the implications of a
248257proposed fix. In such a case it is a good idea for reviewers to
249- `I-compiler-nominate ` the PR (if they intend to stay the main reviewer) or
258+ `I-compiler-nominated ` the PR (if they intend to stay the main reviewer) or
250259assign a compiler team lead to the issue and add the `S-waiting-on-team` label.
251260
252261In both cases, the PR will be brought in the weekly triage meeting. It is also
@@ -280,7 +289,7 @@ get pinged on changes to these parts).
280289Require a doc comment on such APIs identifying which external consumers the API
281290concerns, and for what kinds of purpose.
282291
283- If this is possibly contentious, ask for an [mcp ].
292+ If this is possibly contentious, ask for an [MCP ].
284293
285294Note that this can non-obviously bound supposedly-internal compiler APIs to
286295external consumers. Convey to the external consumers (that are not `rust-lang/`
@@ -291,7 +300,14 @@ refactorings, and no hard stability guarantees are promised.
291300### The PR is very large and complicated
292301
293302Reviewers are **not** expected to stomach PRs that are very large and
294- complicated. Bring the PR to the attention of the team (through zulip threads
303+ complicated. It is expected from contributors to split their work to make a
304+ review feasable, for example a series of more digestible PRs which are
305+ individually more logically self-contained. In general, before submitting large
306+ impact changes, it is expected the contributor to have discussed the design
307+ previously with the relevant team(s) so it is contributor's duty to reference
308+ such discussions.
309+
310+ When in doubt, bring the PR to the attention of the team (through zulip threads
295311and/or nominate for compiler triage meeting), and the team can decide if:
296312
297313- The team can find suitable reviewers who can aid the PR author to break up the
@@ -304,7 +320,7 @@ and/or nominate for compiler triage meeting), and the team can decide if:
304320 a PR stalls for many months only for it to be rejected anyway.
305321
306322
307- [mcp ]: https://forge.rust-lang.org/compiler/mcp.html
323+ [MCP ]: https://forge.rust-lang.org/compiler/mcp.html
308324[whats-a-major-change]:
309325 https://forge.rust-lang.org/compiler/mcp.html#what-constitutes-a-major-change
310326
0 commit comments