Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 6ab6c3c

Browse files
authored
Select Rust edition 2024 for compiling Clippy (rust-lang#13751)
The Cargo feature is no longer experimental and is enabled by default in our nightly compiler. changelog: Clippy now uses Rust edition 2024
2 parents dcbe3ad + a4805ff commit 6ab6c3c

File tree

21 files changed

+31
-29
lines changed

21 files changed

+31
-29
lines changed

.github/workflows/remark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install mdbook
2828
run: |
2929
mkdir mdbook
30-
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.34/mdbook-v0.4.34-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
30+
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.43/mdbook-v0.4.43-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
3131
echo `pwd`/mdbook >> $GITHUB_PATH
3232
3333
# Run

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0"
1010
keywords = ["clippy", "lint", "plugin"]
1111
categories = ["development-tools", "development-tools::cargo-plugins"]
1212
build = "build.rs"
13-
edition = "2021"
13+
edition = "2024"
1414
publish = false
1515

1616
[[bin]]

book/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ src = "src"
66
title = "Clippy Documentation"
77

88
[rust]
9-
edition = "2018"
9+
edition = "2024"
1010

1111
[output.html]
1212
edit-url-template = "https://github.com/rust-lang/rust-clippy/edit/master/book/{path}"

book/src/development/adding_lints.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ via `Tools -> Clippy` and you should see the generated code in the output below.
538538
If the command was executed successfully, you can copy the code over to where
539539
you are implementing your lint.
540540

541-
[author_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=9a12cb60e5c6ad4e3003ac6d5e63cf55
541+
[author_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=9a12cb60e5c6ad4e3003ac6d5e63cf55
542542

543543
## Print HIR lint
544544

@@ -553,7 +553,7 @@ attribute to expressions you often need to enable
553553
_Clippy_.
554554

555555
[_High-Level Intermediate Representation (HIR)_]: https://rustc-dev-guide.rust-lang.org/hir.html
556-
[print_hir_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=daf14db3a7f39ca467cd1b86c34b9afb
556+
[print_hir_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=daf14db3a7f39ca467cd1b86c34b9afb
557557

558558
## Documentation
559559

clippy_config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "clippy_config"
33
# begin autogenerated version
44
version = "0.1.86"
55
# end autogenerated version
6-
edition = "2021"
6+
edition = "2024"
77
publish = false
88

99
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

clippy_dev/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "clippy_dev"
33
description = "Clippy developer tooling"
44
version = "0.0.1"
5-
edition = "2021"
5+
edition = "2024"
66

77
[dependencies]
88
aho-corasick = "1.0"

clippy_dummy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_dummy" # rename to clippy before publishing
33
version = "0.0.303"
4-
edition = "2018"
4+
edition = "2024"
55
readme = "crates-readme.md"
66
description = "A bunch of helpful lints to avoid common pitfalls in Rust."
77
build = 'build.rs'

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repository = "https://github.com/rust-lang/rust-clippy"
88
readme = "README.md"
99
license = "MIT OR Apache-2.0"
1010
keywords = ["clippy", "lint", "plugin"]
11-
edition = "2021"
11+
edition = "2024"
1212

1313
[dependencies]
1414
arrayvec = { version = "0.7", default-features = false }

clippy_utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "clippy_utils"
33
# begin autogenerated version
44
version = "0.1.86"
55
# end autogenerated version
6-
edition = "2021"
6+
edition = "2024"
77
description = "Helpful tools for writing lints, provided as they are used in Clippy"
88
repository = "https://github.com/rust-lang/rust-clippy"
99
readme = "README.md"

lintcheck/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ readme = "README.md"
66
license = "MIT OR Apache-2.0"
77
repository = "https://github.com/rust-lang/rust-clippy"
88
categories = ["development-tools"]
9-
edition = "2021"
9+
edition = "2024"
1010
publish = false
1111
default-run = "lintcheck"
1212

rustc_tools_util/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ readme = "README.md"
77
license = "MIT OR Apache-2.0"
88
keywords = ["rustc", "tool", "git", "version", "hash"]
99
categories = ["development-tools"]
10-
edition = "2018"
10+
edition = "2024"
1111

1212
[dependencies]

rustfmt.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ max_width = 120
22
comment_width = 100
33
match_block_trailing_comma = true
44
wrap_comments = true
5-
edition = "2021"
5+
edition = "2024"
66
error_on_line_overflow = true
77
imports_granularity = "Module"
8-
version = "Two"
8+
style_edition = "2024"
99
ignore = ["tests/ui/crashes/ice-10912.rs"]

tests/compile-test.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@ fn run_ui_cargo(cx: &TestContext) {
300300
}
301301

302302
fn main() {
303-
set_var("CLIPPY_DISABLE_DOCS_LINKS", "true");
303+
unsafe {
304+
set_var("CLIPPY_DISABLE_DOCS_LINKS", "true");
305+
}
304306

305307
let cx = TestContext::new();
306308

tests/ui/crashes/ice-11422.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::fmt::Debug;
44
use std::ops::*;
55

6-
fn gen() -> impl PartialOrd + Debug {}
6+
fn r#gen() -> impl PartialOrd + Debug {}
77

88
struct Bar {}
99
trait Foo<T = Self> {}

tests/ui/crashes/ice-11422.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::fmt::Debug;
44
use std::ops::*;
55

6-
fn gen() -> impl PartialOrd + PartialEq + Debug {}
6+
fn r#gen() -> impl PartialOrd + PartialEq + Debug {}
77

88
struct Bar {}
99
trait Foo<T = Self> {}

tests/ui/crashes/ice-11422.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
error: this bound is already specified as the supertrait of `PartialOrd`
2-
--> tests/ui/crashes/ice-11422.rs:6:31
2+
--> tests/ui/crashes/ice-11422.rs:6:33
33
|
4-
LL | fn gen() -> impl PartialOrd + PartialEq + Debug {}
5-
| ^^^^^^^^^
4+
LL | fn r#gen() -> impl PartialOrd + PartialEq + Debug {}
5+
| ^^^^^^^^^
66
|
77
= note: `-D clippy::implied-bounds-in-impls` implied by `-D warnings`
88
= help: to override `-D warnings` add `#[allow(clippy::implied_bounds_in_impls)]`
99
help: try removing this bound
1010
|
11-
LL - fn gen() -> impl PartialOrd + PartialEq + Debug {}
12-
LL + fn gen() -> impl PartialOrd + Debug {}
11+
LL - fn r#gen() -> impl PartialOrd + PartialEq + Debug {}
12+
LL + fn r#gen() -> impl PartialOrd + Debug {}
1313
|
1414

1515
error: aborting due to 1 previous error

tests/ui/implicit_hasher.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn map<S: ::std::hash::BuildHasher>(map: &mut HashMap<i32, i32, S>) {}
7070
pub fn set<S: ::std::hash::BuildHasher>(set: &mut HashSet<i32, S>) {}
7171

7272
#[inline_macros]
73-
pub mod gen {
73+
pub mod gen_ {
7474
use super::*;
7575
inline! {
7676
impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {

tests/ui/implicit_hasher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn map(map: &mut HashMap<i32, i32>) {}
7070
pub fn set(set: &mut HashSet<i32>) {}
7171

7272
#[inline_macros]
73-
pub mod gen {
73+
pub mod gen_ {
7474
use super::*;
7575
inline! {
7676
impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {

tests/ui/implicit_hasher.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ error: impl for `HashMap` should be generalized over different hashers
9898
LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
9999
| ^^^^^^^^^^^^^
100100
|
101-
= note: this error originates in the macro `__inline_mac_mod_gen` (in Nightly builds, run with -Z macro-backtrace for more info)
101+
= note: this error originates in the macro `__inline_mac_mod_gen_` (in Nightly builds, run with -Z macro-backtrace for more info)
102102
help: add a type parameter for `BuildHasher`
103103
|
104104
LL ~ impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {

tests/ui/map_with_unused_argument_over_ranges.fixed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn do_something_interesting(x: usize, y: usize) -> usize {
1414
todo!()
1515
}
1616

17-
macro_rules! gen {
17+
macro_rules! r#gen {
1818
() => {
1919
(0..10).map(|_| do_something());
2020
};
@@ -45,7 +45,7 @@ fn main() {
4545
std::iter::repeat_with(|| do_something()).take(1);
4646
std::iter::repeat_with(|| do_something()).take((1 << 4) - 0);
4747
// These should not be raised
48-
gen!();
48+
r#gen!();
4949
let lower = 2;
5050
let lower_fn = || 2;
5151
(lower..upper_fn()).map(|_| do_something()); // Ranges not starting at zero not yet handled

tests/ui/map_with_unused_argument_over_ranges.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn do_something_interesting(x: usize, y: usize) -> usize {
1414
todo!()
1515
}
1616

17-
macro_rules! gen {
17+
macro_rules! r#gen {
1818
() => {
1919
(0..10).map(|_| do_something());
2020
};
@@ -45,7 +45,7 @@ fn main() {
4545
(9..=9).map(|_| do_something());
4646
(1..=1 << 4).map(|_| do_something());
4747
// These should not be raised
48-
gen!();
48+
r#gen!();
4949
let lower = 2;
5050
let lower_fn = || 2;
5151
(lower..upper_fn()).map(|_| do_something()); // Ranges not starting at zero not yet handled

0 commit comments

Comments
 (0)