Skip to content

Commit cd3d22d

Browse files
authored
Merge pull request #2748 from phansch/explain_how_to_fix_nightly_build_failures
Explain how to debug and fix nightly build failures
2 parents 7a4c00c + fa0d9c5 commit cd3d22d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ All contributors are expected to follow the [Rust Code of Conduct](http://www.ru
1717
* [Running test suite](#running-test-suite)
1818
* [Testing manually](#testing-manually)
1919
* [How Clippy works](#how-clippy-works)
20+
* [Fixing nightly build failures](#fixing-nightly-build-failures)
2021
* [Contributions](#contributions)
2122

2223
## Getting started
@@ -209,6 +210,17 @@ The difference between `EarlyLintPass` and `LateLintPass` is that the methods of
209210

210211
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.
211212

213+
### Fixing nightly build failures
214+
215+
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.
216+
217+
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].
218+
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.
219+
220+
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.
221+
222+
Fixing nightly build failures is also a good way to learn about actual rustc internals.
223+
212224
## Contributions
213225

214226
Contributions to Clippy should be made in the form of GitHub pull requests. Each pull request will
@@ -229,3 +241,5 @@ All code in this repository is under the [Mozilla Public License, 2.0](https://w
229241
[reg_late_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_plugin/registry/struct.Registry.html#method.register_late_lint_pass
230242
[early_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/lint/trait.EarlyLintPass.html
231243
[late_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/lint/trait.LateLintPass.html
244+
[toolstate_commit_history]: https://github.com/rust-lang-nursery/rust-toolstate/commits/master
245+
[toolstate_commit]: https://github.com/rust-lang-nursery/rust-toolstate/commit/6ce0459f6bfa7c528ae1886492a3e0b5ef0ee547

0 commit comments

Comments
 (0)