2
2
3
3
<!-- toc -->
4
4
5
- ## Bug Reports
5
+ ## Bug reports
6
6
7
7
While bugs are unfortunate, they're a reality in software. We can't fix what we
8
8
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]**.
16
16
If you're using the nightly channel, please check if the bug exists in the
17
17
latest toolchain before filing your bug. It might be fixed already.
18
18
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] ,
21
20
as it's possible that someone else has already reported your error. This doesn't
22
21
always work, and sometimes it's hard to know what to search for, so consider this
23
22
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
33
32
link] ( https://github.com/rust-lang/rust/issues/new/choose ) and filling out the fields
34
33
in the appropriate provided template.
35
34
36
- ## Bug Fixes or "Normal " code changes
35
+ ## Bug fixes or "normal " code changes
37
36
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
39
38
will be reviewed, approved, and merged. This includes most bug fixes,
40
39
refactorings, and other user-invisible changes. The next few sections talk
41
40
about exceptions to this rule.
42
41
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
45
44
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 ).
47
46
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/
50
49
51
- ## New Features
50
+ ## New features
52
51
53
52
Rust has strong backwards-compatibility guarantees. Thus, new features can't
54
53
just be implemented directly in stable Rust. Instead, we have 3 release
@@ -63,13 +62,11 @@ channels: stable, beta, and nightly.
63
62
See [ this chapter on implementing new features] ( ./implementing_new_features.md ) for more
64
63
information.
65
64
66
- ### Breaking Changes
65
+ ### Breaking changes
67
66
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.
69
68
70
- [ breaking-changes ] : ./bug-fix-procedure.md
71
-
72
- ### Major Changes
69
+ ### Major changes
73
70
74
71
The compiler team has a special process for large changes, whether or not they
75
72
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
80
77
to important types, or important changes to how the compiler does something, or
81
78
smaller user-facing changes.
82
79
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
84
81
into a PR that ends up not getting merged!** [ See this document] [ mcpinfo ] for
85
82
more info on MCPs.
86
83
87
84
[ 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
89
86
90
87
### Performance
91
88
@@ -95,19 +92,19 @@ few years into [gradually improving it][perfdash].
95
92
[ perfdash ] : https://perf.rust-lang.org/dashboard.html
96
93
97
94
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
99
96
before approving). This is yet another bot that will compile a collection of
100
97
benchmarks on a compiler with your changes. The numbers are reported
101
98
[ here] [ perf ] , and you can see a comparison of your changes against the latest
102
99
master.
103
100
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] .
106
103
107
104
[ perf ] : https://perf.rust-lang.org
108
105
[ The Rust Performance Book ] : https://nnethercote.github.io/perf-book/
109
106
110
- ## Pull Requests
107
+ ## Pull requests
111
108
112
109
Pull requests (or PRs for short) are the primary mechanism we use to change Rust.
113
110
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
135
132
them instead of a random person. This is entirely optional.
136
133
137
134
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:
140
138
141
139
r? rust-lang/diagnostics
142
140
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] .
147
144
148
145
### Waiting for reviews
149
146
@@ -175,24 +172,21 @@ Zulip ([#t-release/triage]). They have knowledge of when to ping, who might be
175
172
on vacation, etc.
176
173
177
174
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 .
180
177
181
178
[ r? ] : https://github.com/rust-lang/rust/pull/78133#issuecomment-712692371
182
179
[ #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
185
181
186
182
### CI
187
183
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,
189
185
thanks to continuous integration (CI). Basically, every time you open and update
190
186
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
192
188
your pull request is in compliance with Rust's style guidelines.
193
189
194
- [ rctd ] : tests/intro.md
195
-
196
190
Running continuous integration tests allows PR authors to catch mistakes early
197
191
without going through a first review cycle, and also helps reviewers stay aware
198
192
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:
211
205
@bors r+
212
206
213
207
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 ]
215
209
will run * all* the tests on * every* platform we support. If it all works out,
216
210
[ @bors ] will merge your code into ` master ` and close the pull request.
217
211
@@ -228,25 +222,23 @@ Be patient; this can take a while and the queue can sometimes be long. PRs are n
228
222
229
223
[ @rustbot ] : https://github.com/rustbot
230
224
[ @bors ] : https://github.com/bors
231
- [ merge-queue ] : https://bors.rust-lang.org/queue/rust
232
225
233
226
### Opening a PR
234
227
235
228
You are now ready to file a pull request? Great! Here are a few points you
236
229
should be aware of.
237
230
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.
241
233
242
234
Make sure your pull request is in compliance with Rust's style guidelines by running
243
235
244
236
$ ./x test tidy --bless
245
237
246
238
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.
250
242
251
243
Rust follows a _ no merge-commit policy_ , meaning, when you encounter merge
252
244
conflicts you are expected to always rebase instead of merging. E.g. always use
@@ -270,11 +262,11 @@ the issue in question.
270
262
[ labeling ] : ./rustbot.md#issue-relabeling
271
263
[ closing-keywords ] : https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
272
264
273
- ## External Dependencies
265
+ ## External dependencies
274
266
275
267
This section has moved to [ "Using External Repositories"] ( ./external-repos.md ) .
276
268
277
- ## Writing Documentation
269
+ ## Writing documentation
278
270
279
271
Documentation improvements are very welcome. The source of ` doc.rust-lang.org `
280
272
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.
284
276
[ `src/doc` ] : https://github.com/rust-lang/rust/tree/master/src/doc
285
277
[ std-root ] : https://github.com/rust-lang/rust/blob/master/library/std/src/lib.rs#L1
286
278
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] .
290
280
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] .
294
282
295
283
To build the standard library documentation, use ` x doc --stage 0 library --open ` .
296
284
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.
304
292
305
293
### Contributing to rustc-dev-guide
306
294
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
308
296
[ the rust-lang/rustc-dev-guide repo] [ rdgrepo ] .
309
297
The issue tracker in that repo is also a great way to find things that need doing.
310
298
There are issues for beginners and advanced compiler devs alike!
311
299
312
300
Just a few things to keep in mind:
313
301
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 ` .
316
305
317
306
- When contributing text to the guide, please contextualize the information with some time period
318
307
and/or a reason so that the reader knows how much to trust or mistrust the information.
319
308
Aim to provide a reasonable amount of context, possibly including but not limited to:
320
309
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.
323
312
324
313
- The date the comment was added, e.g. instead of writing _ "Currently, ..."_
325
314
or _ "As of now, ..."_ ,
@@ -360,19 +349,15 @@ Just a few things to keep in mind:
360
349
subsections) it might benefit from having a Table of Contents at the beginning, which you can
361
350
auto-generate by including the `<!-- toc -->` marker.
362
351
363
- [rdg]: https://rustc-dev-guide.rust-lang.org/
364
- [rdgrepo]: https://github.com/rust-lang/rustc-dev-guide
352
+ ## Issue triage
365
353
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.
367
356
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.
376
361
377
362
[Thanks to `@rustbot`][rustbot], anyone can help triage issues by adding
378
363
appropriate labels to issues that haven't been triaged yet:
@@ -468,8 +453,19 @@ This is used for [RFCs], issues, and pull requests.
468
453
[rfcbot]: https://github.com/anp/rfcbot-rs/
469
454
[RFCs]: https://github.com/rust-lang/rfcs
470
455
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