Skip to content

Commit 82a4206

Browse files
committed
Apply suggestions from PR review
Also: - Update to latest nightly - Add format change as this uses an older rustfmt version
1 parent f2c339e commit 82a4206

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,26 @@ That's why the `else_if_without_else` example uses the `register_early_pass` fun
182182
[early_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.EarlyLintPass.html
183183
[late_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.LateLintPass.html
184184

185-
## Syncing changes from [`rust-lang/rust`] to Clippy
185+
## Syncing changes between Clippy and [`rust-lang/rust`]
186186

187187
Clippy currently gets built with a pinned nightly version.
188188

189189
In the `rust-lang/rust` repository, where rustc resides, there's a copy of Clippy
190190
that compiler hackers modify from time to time to adapt to changes in the unstable
191191
API of the compiler.
192192

193-
We need to sync these changes back to this repository periodically. If you want
194-
to help with that, you have to sync the `rust-lang/rust-clippy` repository with
195-
the `subtree` copy of Clippy in the `rust-lang/rust` repository, and update
196-
the `rustc-toolchain` file accordingly.
193+
We need to sync these changes back to this repository periodically, and the changes
194+
made to this repository in the meantime also need to be synced to the `rust-lang/rust` repository.
197195

198-
For general information about `subtree`s in the Rust repository
199-
see [Rust's `CONTRIBUTING.md`][subtree].
196+
To avoid flooding the `rust-lang/rust` PR queue, this two-way sync process is done
197+
in a bi-weekly basis if there's no urgent changes. This is done starting on the day of
198+
the Rust stable release and then every other week. That way we guarantee that we keep
199+
this repo up to date with the latest compiler API, and every feature in Clippy is available
200+
for 2 weeks in nightly, before it can get to beta. For reference, the first sync
201+
following this cadence was performed the 2020-08-27.
202+
203+
This process is described in detail in the following sections. For general information
204+
about `subtree`s in the Rust repository see [Rust's `CONTRIBUTING.md`][subtree].
200205

201206
### Patching git-subtree to work with big repos
202207

@@ -225,13 +230,14 @@ This shell has a hardcoded recursion limit set to 1000. In order to make this pr
225230
you need to force the script to run `bash` instead. You can do this by editing the first
226231
line of the `git-subtree` script and changing `sh` to `bash`.
227232

228-
### Performing the sync
233+
### Performing the sync from [`rust-lang/rust`] to Clippy
229234

230235
Here is a TL;DR version of the sync process (all of the following commands have
231236
to be run inside the `rust` directory):
232237

233-
1. Clone the [`rust-lang/rust`] repository
234-
2. Sync the changes to the rust-copy of Clippy to your Clippy fork:
238+
1. Clone the [`rust-lang/rust`] repository or make sure it is up to date.
239+
2. Checkout the commit from the latest available nightly. You can get it using `rustup check`.
240+
3. Sync the changes to the rust-copy of Clippy to your Clippy fork:
235241
```bash
236242
# Make sure to change `your-github-name` to your github name in the following command
237243
git subtree push -P src/tools/clippy [email protected]:your-github-name/rust-clippy sync-from-rust
@@ -249,17 +255,11 @@ to be run inside the `rust` directory):
249255
git checkout sync-from-rust
250256
git merge upstream/master
251257
```
252-
3. Open a PR to `rust-lang/rust-clippy` and wait for it to get merged (to
258+
4. Open a PR to `rust-lang/rust-clippy` and wait for it to get merged (to
253259
accelerate the process ping the `@rust-lang/clippy` team in your PR and/or
254260
~~annoy~~ ask them in the [Zulip] stream.)
255-
256-
### Syncing back changes in Clippy to [`rust-lang/rust`]
257261

258-
To avoid flooding the [`rust-lang/rust`] PR queue, changes in Clippy's repo are synced back
259-
in a bi-weekly basis if there's no urgent changes. This is done starting on the day of
260-
the Rust stable release and then every other week. That way we guarantee that
261-
every feature in Clippy is available for 2 weeks in nightly, before it can get to beta.
262-
For reference, the first sync following this cadence was performed the 2020-08-27.
262+
### Performing the sync from Clippy to [`rust-lang/rust`]
263263

264264
All of the following commands have to be run inside the `rust` directory.
265265

clippy_lints/src/types.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,9 +1104,7 @@ fn is_empty_block(expr: &Expr<'_>) -> bool {
11041104
expr.kind,
11051105
ExprKind::Block(
11061106
Block {
1107-
stmts: &[],
1108-
expr: None,
1109-
..
1107+
stmts: &[], expr: None, ..
11101108
},
11111109
_,
11121110
)

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2020-11-29"
2+
channel = "nightly-2020-12-09"
33
components = ["llvm-tools-preview", "rustc-dev", "rust-src", "rustfmt"]

0 commit comments

Comments
 (0)