From 9c50aa88105946a979afcfe0b2780195e73c2331 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Wed, 19 Sep 2018 21:12:51 +0200 Subject: [PATCH 1/4] Mention how to install master Rust in CONTRIBUTING --- CONTRIBUTING.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d1385244a6..fc5372bd7a0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ All contributors are expected to follow the [Rust Code of Conduct](http://www.ru * [Running test suite](#running-test-suite) * [Testing manually](#testing-manually) * [How Clippy works](#how-clippy-works) - * [Fixing nightly build failures](#fixing-nightly-build-failures) + * [Fixing nightly build failures](#fixing-build-failures-caused-by-rust) * [Contributions](#contributions) ## Getting started @@ -202,16 +202,29 @@ The difference between `EarlyLintPass` and `LateLintPass` is that the methods of 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. -### Fixing nightly build failures +### Fixing build failures caused by Rust -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. +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. -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]. +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]. 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. 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. -Fixing nightly build failures is also a good way to learn about actual rustc internals. +Fixing build failures caused by rustc changes is also a good way to learn about actual rustc internals. + +If you decide to make Clippy work again with a Rust commit that breaks Clippy, +you probably want to install the latest Rust from master locally and run Clippy +using that version of Rust. + +You can use [rustup-toolchain-install-master][rtim] to do that: + +``` +cargo install rustup-toolchain-install-master +rustup-toolchain-install-master -n master --force +rustup override set master +cargo test +``` ## Contributions @@ -235,3 +248,4 @@ All code in this repository is under the [Mozilla Public License, 2.0](https://w [late_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/lint/trait.LateLintPass.html [toolstate_commit_history]: https://github.com/rust-lang-nursery/rust-toolstate/commits/master [toolstate_commit]: https://github.com/rust-lang-nursery/rust-toolstate/commit/6ce0459f6bfa7c528ae1886492a3e0b5ef0ee547 +[rtim]: https://github.com/kennytm/rustup-toolchain-install-master From f9511bfdc3753f22cfc33d53159bcd4226c307c2 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Thu, 20 Sep 2018 06:56:13 +0200 Subject: [PATCH 2/4] s/rust/Rust, repeat 'Clippy' less --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fc5372bd7a0..57260b17cf7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -204,16 +204,16 @@ That's why the `else_if_without_else` example uses the `register_early_lint_pass ### Fixing build failures caused by Rust -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. +Clippy will sometimes break because it 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. 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]. 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. 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. -Fixing build failures caused by rustc changes is also a good way to learn about actual rustc internals. +Fixing build failures caused by rustc updates, can also be a good way to learn about rustc internals. -If you decide to make Clippy work again with a Rust commit that breaks Clippy, +If you decide to make Clippy work again with a Rust commit that breaks it, you probably want to install the latest Rust from master locally and run Clippy using that version of Rust. From 2b57cec649013e5209d10c6b83ecc963b019c3e1 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Thu, 20 Sep 2018 06:58:07 +0200 Subject: [PATCH 3/4] s/rustc/Rust/ --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 57260b17cf7..dda6ebb50d6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -211,7 +211,7 @@ You will then have to look for the last commit that contains `test-pass -> build 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. -Fixing build failures caused by rustc updates, can also be a good way to learn about rustc internals. +Fixing build failures caused by Rust updates, can also be a good way to learn about Rust internals. If you decide to make Clippy work again with a Rust commit that breaks it, you probably want to install the latest Rust from master locally and run Clippy From f72cfc2985d1db30d351e425ec7f45f6b0a328a5 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Thu, 20 Sep 2018 07:10:23 +0200 Subject: [PATCH 4/4] Mention rustup component history --- CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dda6ebb50d6..1341ca30ebd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -204,14 +204,15 @@ That's why the `else_if_without_else` example uses the `register_early_lint_pass ### Fixing build failures caused by Rust -Clippy will sometimes break because it 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. +Clippy will sometimes break because it 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. Fixing build failures caused by Rust updates, can be a good way to learn about Rust internals. 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]. 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. 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. -Fixing build failures caused by Rust updates, can also be a good way to learn about Rust internals. +To check if Clippy is available for a specific target platform, you can check +the [rustup component history][rustup_component_history]. If you decide to make Clippy work again with a Rust commit that breaks it, you probably want to install the latest Rust from master locally and run Clippy @@ -249,3 +250,4 @@ All code in this repository is under the [Mozilla Public License, 2.0](https://w [toolstate_commit_history]: https://github.com/rust-lang-nursery/rust-toolstate/commits/master [toolstate_commit]: https://github.com/rust-lang-nursery/rust-toolstate/commit/6ce0459f6bfa7c528ae1886492a3e0b5ef0ee547 [rtim]: https://github.com/kennytm/rustup-toolchain-install-master +[rustup_component_history]: https://mexus.github.io/rustup-components-history