Skip to content

Commit 6d5b3db

Browse files
authored
various fixes/improvements to Contributing chapter (#1723)
1 parent 0658909 commit 6d5b3db

File tree

1 file changed

+69
-73
lines changed

1 file changed

+69
-73
lines changed

Diff for: src/contributing.md

+69-73
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!-- toc -->
44

5-
## Bug Reports
5+
## Bug reports
66

77
While bugs are unfortunate, they're a reality in software. We can't fix what we
88
don't know about, so please report liberally. If you're not sure if something
@@ -16,8 +16,7 @@ please follow our [instructions for reporting security vulnerabilities][vuln]**.
1616
If you're using the nightly channel, please check if the bug exists in the
1717
latest toolchain before filing your bug. It might be fixed already.
1818

19-
If you have the chance, before reporting a bug, please [search existing
20-
issues](https://github.com/rust-lang/rust/issues?q=is%3Aissue),
19+
If you have the chance, before reporting a bug, please [search existing issues],
2120
as it's possible that someone else has already reported your error. This doesn't
2221
always work, and sometimes it's hard to know what to search for, so consider this
2322
extra credit. We won't mind if you accidentally file a duplicate report.
@@ -33,22 +32,22 @@ Opening an issue is as easy as following [this
3332
link](https://github.com/rust-lang/rust/issues/new/choose) and filling out the fields
3433
in the appropriate provided template.
3534

36-
## Bug Fixes or "Normal" code changes
35+
## Bug fixes or "normal" code changes
3736

38-
For most PRs, no special procedures are needed. You can just [open a PR][prs], and it
37+
For most PRs, no special procedures are needed. You can just [open a PR], and it
3938
will be reviewed, approved, and merged. This includes most bug fixes,
4039
refactorings, and other user-invisible changes. The next few sections talk
4140
about exceptions to this rule.
4241

43-
Also, note that it is perfectly acceptable to open WIP PRs or GitHub [Draft
44-
PRs][draft]. Some people prefer to do this so they can get feedback along the
42+
Also, note that it is perfectly acceptable to open WIP PRs or GitHub [Draft PRs].
43+
Some people prefer to do this so they can get feedback along the
4544
way or share their code with a collaborator. Others do this so they can utilize
46-
the CI to build and test their PR (e.g. if you are developing on a laptop).
45+
the CI to build and test their PR (e.g. when developing on a slow machine).
4746

48-
[prs]: #pull-requests
49-
[draft]: https://github.blog/2019-02-14-introducing-draft-pull-requests/
47+
[open a PR]: #pull-requests
48+
[Draft PRs]: https://github.blog/2019-02-14-introducing-draft-pull-requests/
5049

51-
## New Features
50+
## New features
5251

5352
Rust has strong backwards-compatibility guarantees. Thus, new features can't
5453
just be implemented directly in stable Rust. Instead, we have 3 release
@@ -63,13 +62,11 @@ channels: stable, beta, and nightly.
6362
See [this chapter on implementing new features](./implementing_new_features.md) for more
6463
information.
6564

66-
### Breaking Changes
65+
### Breaking changes
6766

68-
Breaking changes have a [dedicated section][breaking-changes] in the dev-guide.
67+
Breaking changes have a [dedicated section][Breaking Changes] in the dev-guide.
6968

70-
[breaking-changes]: ./bug-fix-procedure.md
71-
72-
### Major Changes
69+
### Major changes
7370

7471
The compiler team has a special process for large changes, whether or not they
7572
cause breakage. This process is called a Major Change Proposal (MCP). MCP is a
@@ -80,12 +77,12 @@ Example of things that might require MCPs include major refactorings, changes
8077
to important types, or important changes to how the compiler does something, or
8178
smaller user-facing changes.
8279

83-
**When in doubt, ask on [zulip][z]. It would be a shame to put a lot of work
80+
**When in doubt, ask on [zulip]. It would be a shame to put a lot of work
8481
into a PR that ends up not getting merged!** [See this document][mcpinfo] for
8582
more info on MCPs.
8683

8784
[mcpinfo]: https://forge.rust-lang.org/compiler/mcp.html
88-
[z]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler
85+
[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler
8986

9087
### Performance
9188

@@ -95,19 +92,19 @@ few years into [gradually improving it][perfdash].
9592
[perfdash]: https://perf.rust-lang.org/dashboard.html
9693

9794
If you suspect that your change may cause a performance regression (or
98-
improvement), you can request a "perf run" (your reviewer may also request one
95+
improvement), you can request a "perf run" (and your reviewer may also request one
9996
before approving). This is yet another bot that will compile a collection of
10097
benchmarks on a compiler with your changes. The numbers are reported
10198
[here][perf], and you can see a comparison of your changes against the latest
10299
master.
103100

104-
For an introduction to the performance of Rust code in general
105-
which would also be useful in rustc development, see [The Rust Performance Book].
101+
> For an introduction to the performance of Rust code in general
102+
> which would also be useful in rustc development, see [The Rust Performance Book].
106103
107104
[perf]: https://perf.rust-lang.org
108105
[The Rust Performance Book]: https://nnethercote.github.io/perf-book/
109106

110-
## Pull Requests
107+
## Pull requests
111108

112109
Pull requests (or PRs for short) are the primary mechanism we use to change Rust.
113110
GitHub itself has some [great documentation][about-pull-requests] on using the
@@ -135,15 +132,15 @@ to the end of the pull request description, and [@rustbot] will assign
135132
them instead of a random person. This is entirely optional.
136133

137134
You can also assign a random reviewer from a specific team by writing `r? rust-lang/groupname`.
138-
So if you were making a diagnostics change, then you could get a reviewer from the diagnostics
139-
team by adding:
135+
As an example,
136+
if you were making a diagnostics change,
137+
then you could get a reviewer from the diagnostics team by adding:
140138

141139
r? rust-lang/diagnostics
142140

143-
For a full list of possible `groupname` check the `adhoc_groups` section at the
144-
[triagebot.toml config file](https://github.com/rust-lang/rust/blob/master/triagebot.toml)
145-
or the list of teams in the [rust-lang teams
146-
database](https://github.com/rust-lang/team/tree/master/teams).
141+
For a full list of possible `groupname`s,
142+
check the `adhoc_groups` section at the [triagebot.toml config file],
143+
or the list of teams in the [rust-lang teams database].
147144

148145
### Waiting for reviews
149146

@@ -175,24 +172,21 @@ Zulip ([#t-release/triage]). They have knowledge of when to ping, who might be
175172
on vacation, etc.
176173

177174
The reviewer may request some changes using the GitHub code review interface.
178-
They may also request special procedures (such as a [crater] run; [see
179-
below][break]) for some PRs.
175+
They may also request special procedures for some PRs.
176+
See [Crater] and [Breaking Changes] chapters for some examples of such procedures.
180177

181178
[r?]: https://github.com/rust-lang/rust/pull/78133#issuecomment-712692371
182179
[#t-release/triage]: https://rust-lang.zulipchat.com/#narrow/stream/242269-t-release.2Ftriage
183-
[break]: #breaking-changes
184-
[crater]: tests/crater.md
180+
[Crater]: tests/crater.md
185181

186182
### CI
187183

188-
In addition to being reviewed by a human, pull requests are automatically tested
184+
In addition to being reviewed by a human, pull requests are automatically tested,
189185
thanks to continuous integration (CI). Basically, every time you open and update
190186
a pull request, CI builds the compiler and tests it against the
191-
[compiler test suite][rctd], and also performs other tests such as checking that
187+
[compiler test suite], and also performs other tests such as checking that
192188
your pull request is in compliance with Rust's style guidelines.
193189

194-
[rctd]: tests/intro.md
195-
196190
Running continuous integration tests allows PR authors to catch mistakes early
197191
without going through a first review cycle, and also helps reviewers stay aware
198192
of the status of a particular pull request.
@@ -211,7 +205,7 @@ on the pull request with an `r+`. It will look something like this:
211205
@bors r+
212206

213207
This tells [@bors], our lovable integration bot, that your pull request has
214-
been approved. The PR then enters the [merge queue][merge-queue], where [@bors]
208+
been approved. The PR then enters the [merge queue], where [@bors]
215209
will run *all* the tests on *every* platform we support. If it all works out,
216210
[@bors] will merge your code into `master` and close the pull request.
217211

@@ -228,25 +222,23 @@ Be patient; this can take a while and the queue can sometimes be long. PRs are n
228222

229223
[@rustbot]: https://github.com/rustbot
230224
[@bors]: https://github.com/bors
231-
[merge-queue]: https://bors.rust-lang.org/queue/rust
232225

233226
### Opening a PR
234227

235228
You are now ready to file a pull request? Great! Here are a few points you
236229
should be aware of.
237230

238-
All pull requests should be filed against the `master` branch, except in very
239-
particular scenarios. Unless you know for sure that you should target another
240-
branch, `master` will be the right choice (it's also the default).
231+
All pull requests should be filed against the `master` branch,
232+
unless you know for sure that you should target a different branch.
241233

242234
Make sure your pull request is in compliance with Rust's style guidelines by running
243235

244236
$ ./x test tidy --bless
245237

246238
We recommend to make this check before every pull request (and every new commit
247-
in a pull request); you can add [git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)
248-
before every push to make sure you never forget to make this check. The
249-
CI will also run tidy and will fail if tidy fails.
239+
in a pull request); you can add [git hooks]
240+
before every push to make sure you never forget to make this check.
241+
The CI will also run tidy and will fail if tidy fails.
250242

251243
Rust follows a _no merge-commit policy_, meaning, when you encounter merge
252244
conflicts you are expected to always rebase instead of merging. E.g. always use
@@ -270,11 +262,11 @@ the issue in question.
270262
[labeling]: ./rustbot.md#issue-relabeling
271263
[closing-keywords]: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
272264

273-
## External Dependencies
265+
## External dependencies
274266

275267
This section has moved to ["Using External Repositories"](./external-repos.md).
276268

277-
## Writing Documentation
269+
## Writing documentation
278270

279271
Documentation improvements are very welcome. The source of `doc.rust-lang.org`
280272
is located in [`src/doc`] in the tree, and standard API documentation is generated
@@ -284,13 +276,9 @@ function in the same way as other pull requests.
284276
[`src/doc`]: https://github.com/rust-lang/rust/tree/master/src/doc
285277
[std-root]: https://github.com/rust-lang/rust/blob/master/library/std/src/lib.rs#L1
286278

287-
To find documentation-related issues, sort by the [A-docs label][adocs].
288-
289-
[adocs]: https://github.com/rust-lang/rust/issues?q=is%3Aopen%20is%3Aissue%20label%3AA-docs
279+
To find documentation-related issues, sort by the [A-docs label].
290280

291-
You can find documentation style guidelines in [RFC 1574][rfc1574].
292-
293-
[rfc1574]: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
281+
You can find documentation style guidelines in [RFC 1574].
294282

295283
To build the standard library documentation, use `x doc --stage 0 library --open`.
296284
To build the documentation for a book (e.g. the unstable book), use `x doc src/doc/unstable-book.`
@@ -304,22 +292,23 @@ The CSS might be messed up, but you can verify that the HTML is right.
304292

305293
### Contributing to rustc-dev-guide
306294

307-
Contributions to the [rustc-dev-guide][rdg] are always welcome, and can be made directly at
295+
Contributions to the [rustc-dev-guide] are always welcome, and can be made directly at
308296
[the rust-lang/rustc-dev-guide repo][rdgrepo].
309297
The issue tracker in that repo is also a great way to find things that need doing.
310298
There are issues for beginners and advanced compiler devs alike!
311299

312300
Just a few things to keep in mind:
313301

314-
- Please limit line length to 100 characters. This is enforced by CI, and you can run the checks
315-
locally with `ci/lengthcheck.sh`.
302+
- Please limit line length to 100 characters.
303+
This is enforced by CI,
304+
and you can run the checks locally with `ci/lengthcheck.sh`.
316305

317306
- When contributing text to the guide, please contextualize the information with some time period
318307
and/or a reason so that the reader knows how much to trust or mistrust the information.
319308
Aim to provide a reasonable amount of context, possibly including but not limited to:
320309

321-
- A reason for why the data may be out of date other than "change", as change is a constant across
322-
the project.
310+
- A reason for why the data may be out of date other than "change",
311+
as change is a constant across the project.
323312

324313
- The date the comment was added, e.g. instead of writing _"Currently, ..."_
325314
or _"As of now, ..."_,
@@ -360,19 +349,15 @@ Just a few things to keep in mind:
360349
subsections) it might benefit from having a Table of Contents at the beginning, which you can
361350
auto-generate by including the `<!-- toc -->` marker.
362351

363-
[rdg]: https://rustc-dev-guide.rust-lang.org/
364-
[rdgrepo]: https://github.com/rust-lang/rustc-dev-guide
352+
## Issue triage
365353

366-
## Issue Triage
354+
Sometimes, an issue will stay open, even though the bug has been fixed.
355+
And sometimes, the original bug may go stale because something has changed in the meantime.
367356

368-
Sometimes, an issue will stay open, even though the bug has been fixed. And
369-
sometimes, the original bug may go stale because something has changed in the
370-
meantime.
371-
372-
It can be helpful to go through older bug reports and make sure that they are
373-
still valid. Load up an older issue, double check that it's still true, and
374-
leave a comment letting us know if it is or is not. The [least recently
375-
updated sort][lru] is good for finding issues like this.
357+
It can be helpful to go through older bug reports and make sure that they are still valid.
358+
Load up an older issue, double check that it's still true,
359+
and leave a comment letting us know if it is or is not.
360+
The [least recently updated sort][lru] is good for finding issues like this.
376361

377362
[Thanks to `@rustbot`][rustbot], anyone can help triage issues by adding
378363
appropriate labels to issues that haven't been triaged yet:
@@ -468,8 +453,19 @@ This is used for [RFCs], issues, and pull requests.
468453
[rfcbot]: https://github.com/anp/rfcbot-rs/
469454
[RFCs]: https://github.com/rust-lang/rfcs
470455

471-
## Helpful Links and Information
472-
473-
This section has moved to the ["About this guide"][more-links] chapter.
474-
475-
[more-links]: ./about-this-guide.md#other-places-to-find-information
456+
## Helpful links and information
457+
458+
This section has moved to the ["About this guide"] chapter.
459+
460+
["About this guide"]: about-this-guide.md#other-places-to-find-information
461+
[search existing issues]: https://github.com/rust-lang/rust/issues?q=is%3Aissue
462+
[Breaking Changes]: bug-fix-procedure.md
463+
[triagebot.toml config file]: https://github.com/rust-lang/rust/blob/HEAD/triagebot.toml
464+
[rust-lang teams database]: https://github.com/rust-lang/team/tree/HEAD/teams
465+
[compiler test suite]: tests/intro.md
466+
[merge queue]: https://bors.rust-lang.org/queue/rust
467+
[git hooks]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
468+
[A-docs label]: https://github.com/rust-lang/rust/issues?q=is%3Aopen%20is%3Aissue%20label%3AA-docs
469+
[RFC 1574]: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
470+
[rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/
471+
[rdgrepo]: https://github.com/rust-lang/rustc-dev-guide

0 commit comments

Comments
 (0)