11# Contributing to Rust
2+ [ contributing-to-rust ] : #contributing-to-rust
23
34Thank you for your interest in contributing to Rust! There are many ways to
45contribute, and we appreciate all of them. This document is a bit long, so here's
@@ -18,18 +19,20 @@ hop on [#rust-internals][pound-rust-internals].
1819
1920As a reminder, all contributors are expected to follow our [ Code of Conduct] [ coc ] .
2021
21- [ pound-rust-internals ] : http ://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
22+ [ pound-rust-internals ] : https ://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
2223[ internals ] : https://internals.rust-lang.org
2324[ coc ] : https://www.rust-lang.org/conduct.html
2425
2526## Feature Requests
27+ [ feature-requests ] : #feature-requests
2628
2729To request a change to the way that the Rust language works, please open an
2830issue in the [ RFCs repository] ( https://github.com/rust-lang/rfcs/issues/new )
2931rather than this one. New features and other significant language changes
3032must go through the RFC process.
3133
3234## Bug Reports
35+ [ bug-reports ] : #bug-reports
3336
3437While bugs are unfortunate, they're a reality in software. We can't fix what we
3538don't know about, so please report liberally. If you're not sure if something
@@ -80,6 +83,7 @@ $ RUST_BACKTRACE=1 rustc ...
8083```
8184
8285## The Build System
86+ [ the-build-system ] : #the-build-system
8387
8488Rust's build system allows you to bootstrap the compiler, run tests &
8589benchmarks, generate documentation, install a fresh build of Rust, and more.
@@ -94,6 +98,7 @@ system internals, try asking in [`#rust-internals`][pound-rust-internals].
9498[ bootstrap ] : https://github.com/rust-lang/rust/tree/master/src/bootstrap/
9599
96100### Configuration
101+ [ configuration ] : #configuration
97102
98103Before you can start building the compiler you need to configure the build for
99104your system. In most cases, that will just mean using the defaults provided
@@ -125,6 +130,11 @@ file. If you still have a `config.mk` file in your directory - from
125130` ./configure ` - you may need to delete it for ` config.toml ` to work.
126131
127132### Building
133+ [ building ] : #building
134+
135+ Dependencies
136+ - [ build dependencies] ( README.md#building-from-source )
137+ - ` gdb ` 6.2.0 minimum, 7.1 or later recommended for test builds
128138
129139The build system uses the ` x.py ` script to control the build process. This script
130140is used to build, test, and document various parts of the compiler. You can
@@ -194,6 +204,7 @@ Note: Previously `./configure` and `make` were used to build this project.
194204They are still available, but ` x.py ` is the recommended build system.
195205
196206### Useful commands
207+ [ useful-commands ] : #useful-commands
197208
198209Some common invocations of ` x.py ` are:
199210
@@ -234,6 +245,7 @@ Some common invocations of `x.py` are:
234245 code.
235246
236247### Using your local build
248+ [ using-local-build ] : #using-local-build
237249
238250If you use Rustup to manage your rust install, it has a feature called [ "custom
239251toolchains"] [ toolchain-link ] that you can use to access your newly-built compiler
@@ -262,6 +274,7 @@ stage 1. `python x.py build --stage 1 src/libstd src/tools/rustdoc` will build
262274rustdoc and libstd, which will allow rustdoc to be run with that toolchain.)
263275
264276## Pull Requests
277+ [ pull-requests ] : #pull-requests
265278
266279Pull requests are the primary mechanism we use to change Rust. GitHub itself
267280has some [ great documentation] [ pull-requests ] on using the Pull Request feature.
@@ -326,20 +339,32 @@ it can be found
326339[ here] ( https://github.com/rust-lang/rust-wiki-backup/blob/master/Note-testsuite.md ) .
327340
328341### External Dependencies
342+ [ external-dependencies ] : #external-dependencies
329343
330344Currently building Rust will also build the following external projects:
331345
332346* [ clippy] ( https://github.com/rust-lang-nursery/rust-clippy )
333347* [ miri] ( https://github.com/solson/miri )
334348
335349If your changes break one of these projects, you need to fix them by opening
336- a pull request against the broken project. When you have opened a pull request,
337- you can disable the tool via ` src/tools/toolstate.toml ` .
350+ a pull request against the broken project asking to put the fix on a branch.
351+ Then you can disable the tool building via ` src/tools/toolstate.toml ` .
352+ Once the branch containing your fix is likely to be merged, you can point
353+ the affected submodule at this branch.
354+
355+ Don't forget to also add your changes with
356+
357+ ```
358+ git add path/to/submodule
359+ ```
360+
361+ outside the submodule.
338362
339363It can also be more convenient during development to set ` submodules = false `
340364in the ` config.toml ` to prevent ` x.py ` from resetting to the original branch.
341365
342366## Writing Documentation
367+ [ writing-documentation ] : #writing-documentation
343368
344369Documentation improvements are very welcome. The source of ` doc.rust-lang.org `
345370is located in ` src/doc ` in the tree, and standard API documentation is generated
@@ -370,6 +395,7 @@ reference to `doc/reference.html`. The CSS might be messed up, but you can
370395verify that the HTML is right.
371396
372397## Issue Triage
398+ [ issue-triage ] : #issue-triage
373399
374400Sometimes, an issue will stay open, even though the bug has been fixed. And
375401sometimes, the original bug may go stale because something has changed in the
@@ -437,6 +463,7 @@ If you're looking for somewhere to start, check out the [E-easy][eeasy] tag.
437463[ rfcbot ] : https://github.com/dikaiosune/rust-dashboard/blob/master/RFCBOT.md
438464
439465## Out-of-tree Contributions
466+ [ out-of-tree-contributions ] : #out-of-tree-contributions
440467
441468There are a number of other ways to contribute to Rust that don't deal with
442469this repository.
@@ -456,6 +483,7 @@ valuable!
456483[ community-library ] : https://github.com/rust-lang/rfcs/labels/A-community-library
457484
458485## Helpful Links and Information
486+ [ helpful-info ] : #helpful-info
459487
460488For people new to Rust, and just starting to contribute, or even for
461489more seasoned developers, some useful places to look for information
0 commit comments