Skip to content

Commit 9c50aa8

Browse files
committed
Mention how to install master Rust in CONTRIBUTING
1 parent 3fee6d6 commit 9c50aa8

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ All contributors are expected to follow the [Rust Code of Conduct](http://www.ru
1919
* [Running test suite](#running-test-suite)
2020
* [Testing manually](#testing-manually)
2121
* [How Clippy works](#how-clippy-works)
22-
* [Fixing nightly build failures](#fixing-nightly-build-failures)
22+
* [Fixing nightly build failures](#fixing-build-failures-caused-by-rust)
2323
* [Contributions](#contributions)
2424

2525
## Getting started
@@ -202,16 +202,29 @@ The difference between `EarlyLintPass` and `LateLintPass` is that the methods of
202202

203203
That's why the `else_if_without_else` example uses the `register_early_lint_pass` function. Because the [actual lint logic][else_if_without_else] does not depend on any type information.
204204

205-
### Fixing nightly build failures
205+
### Fixing build failures caused by Rust
206206

207-
Clippy will sometimes break with new nightly version releases. This is expected because Clippy still depends on nightly Rust. Most of the times we have to adapt to the changes and only very rarely there's an actual bug in rust.
207+
Clippy will sometimes break because Clippy still depends on unstable internal Rust features. Most of the times we have to adapt to the changes and only very rarely there's an actual bug in rust.
208208

209-
In order to find out why Clippy does not work properly with a new nightly version, you can use the [rust-toolstate commit history][toolstate_commit_history].
209+
In order to find out why Clippy does not work properly with a new Rust commit, you can use the [rust-toolstate commit history][toolstate_commit_history].
210210
You will then have to look for the last commit that contains `test-pass -> build-fail` or `test-pass` -> `test-fail` for the `clippy-driver` component. [Here][toolstate_commit] is an example.
211211

212212
The commit message contains a link to the PR. The PRs are usually small enough to discover the breaking API change and if they are bigger, they likely include some discussion that may help you to fix Clippy.
213213

214-
Fixing nightly build failures is also a good way to learn about actual rustc internals.
214+
Fixing build failures caused by rustc changes is also a good way to learn about actual rustc internals.
215+
216+
If you decide to make Clippy work again with a Rust commit that breaks Clippy,
217+
you probably want to install the latest Rust from master locally and run Clippy
218+
using that version of Rust.
219+
220+
You can use [rustup-toolchain-install-master][rtim] to do that:
221+
222+
```
223+
cargo install rustup-toolchain-install-master
224+
rustup-toolchain-install-master -n master --force
225+
rustup override set master
226+
cargo test
227+
```
215228

216229
## Contributions
217230

@@ -235,3 +248,4 @@ All code in this repository is under the [Mozilla Public License, 2.0](https://w
235248
[late_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/lint/trait.LateLintPass.html
236249
[toolstate_commit_history]: https://github.com/rust-lang-nursery/rust-toolstate/commits/master
237250
[toolstate_commit]: https://github.com/rust-lang-nursery/rust-toolstate/commit/6ce0459f6bfa7c528ae1886492a3e0b5ef0ee547
251+
[rtim]: https://github.com/kennytm/rustup-toolchain-install-master

0 commit comments

Comments
 (0)