Skip to content

Commit 4da6ab1

Browse files
authored
Bump linter to nightly-2025-01-09 (#215)
Rust 1.84 has been released, meaning it's time to bump our Rust toolchain and `clippy_utils`! Additionally, I've written some documentation on how to do this so that others can follow the same steps.
1 parent e885b87 commit 4da6ab1

File tree

7 files changed

+43
-6
lines changed

7 files changed

+43
-6
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bevy_lint/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ harness = false
2828
# Contains a series of useful utilities when writing lints. The version is chosen to work with the
2929
# currently pinned nightly Rust version. When the Rust version changes, this too needs to be
3030
# updated!
31-
clippy_utils = "=0.1.85"
31+
clippy_utils = "=0.1.86"
3232

3333
# Easy error propagation and contexts.
3434
anyhow = "1.0.86"

bevy_lint/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ There are several other ways to toggle lints, but they have varying levels of su
154154

155155
|`bevy_lint` Version|Rust Version|Rustup Toolchain|Bevy Version|
156156
|-|-|-|-|
157-
|0.2.0-dev|1.84.0|`nightly-2024-11-28`|0.15|
157+
|0.2.0-dev|1.84.0|`nightly-2025-01-09`|0.15|
158158
|0.1.0|1.84.0|`nightly-2024-11-14`|0.14|
159159

160160
The Rust version in the above table specifies what [version of the Rust language](https://github.com/rust-lang/rust/releases) can be compiled with `bevy_lint`. Code written for a later version of Rust may not compile. (This is not usually an issue, though, because `bevy_lint`'s Rust version is kept 1 to 2 releases ahead of stable Rust.)

bevy_lint/docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Thanks for your interest in contributing to `bevy_lint`! Please feel free to ski
77
- [Setting up your Editor](how-to/editor.md)
88
- [How to Work with Types](how-to/types.md)
99
- [How to Release `bevy_lint`](how-to/release.md)
10+
- [Bump to a Newer Version of Rust](how-to/bump-rust.md)
1011
- [Reference](reference/)
1112
- [Explanations](explanations/)
1213

bevy_lint/docs/how-to/bump-rust.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# How to Bump to a Newer Version of Rust
2+
3+
`bevy_lint` matches nightly Rust versions with `clippy_utils`. A new version of `clippy_utils` is released with each version of Rust, which `bevy_lint` should keep up to date with.
4+
5+
1. Go to [`clippy_utils`'s page on crates.io](https://crates.io/crates/clippy_utils) and find the nightly toolchain it requires. For example:
6+
7+
> This crate is only guaranteed to build with this nightly toolchain:
8+
>
9+
> ```
10+
> nightly-2025-01-09
11+
> ```
12+
13+
2. Change the `channel` field in [`rust-toolchain.toml`](../../../rust-toolchain.toml) to the version specified by `clippy_utils`.
14+
3. Update the [compatibility table in `README.md`](../../README.md#compatibility) for the latest `-dev` version.
15+
4. Increase the version of `clippy_utils` in [`Cargo.toml`](../../Cargo.toml) to the latest version.
16+
17+
Once you've finished upgrading the Rust toolchain and `clippy_utils`, there are a few extra steps that can verify `bevy_lint` still functions the same.
18+
19+
1. Read over the [release notes](https://github.com/rust-lang/rust/releases) for potentially breaking changes.
20+
2. Skim through [diff.rs for `clippy_utils`](https://diff.rs/clippy_utils) to see if anything the linter uses may have changed.
21+
- `clippy_utils` doesn't provide a user-facing changelog, unfortunately. You may find the [Git history](https://github.com/rust-lang/rust-clippy/commits/master/clippy_utils) useful, though!
22+
3. Verify you've installed the latest pinned Rust toolchain. If you use Rustup, it should be automatically installed the first time you run `rustc` or `cargo` in the workspace.
23+
24+
```shell
25+
rustc --version
26+
```
27+
28+
4. Test that the linter still compiles and passes all tests.
29+
30+
```shell
31+
cargo clean
32+
cargo build
33+
cargo test
34+
```

bevy_lint/src/bin/driver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ fn main() -> ExitCode {
3939
args.remove(0);
4040

4141
// Call the compiler with our custom callback.
42-
RunCompiler::new(&args, &mut BevyLintCallback).run()
42+
RunCompiler::new(&args, &mut BevyLintCallback).run();
43+
44+
Ok(())
4345
});
4446

4547
// We truncate the `i32` to a `u8`. `catch_with_exit_code()` currently only returns 1 or 0, so

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
[toolchain]
55
# Writing custom lints requires using nightly Rust. We pin to a specific version of nightly version
66
# so that builds are reproducible.
7-
channel = "nightly-2024-11-28"
7+
channel = "nightly-2025-01-09"
88
# These components are required to use `rustc` crates.
99
components = ["rustc-dev", "llvm-tools-preview"]

0 commit comments

Comments
 (0)