From b1fa2842b10308b1ac3d482cef2f6ec316b2e98f Mon Sep 17 00:00:00 2001 From: xFrednet Date: Mon, 29 Apr 2024 21:26:14 +0200 Subject: [PATCH 1/3] Update version attribute for 1.78 lints --- clippy_lints/src/assigning_clones.rs | 2 +- clippy_lints/src/cargo/mod.rs | 2 +- clippy_lints/src/casts/mod.rs | 2 +- clippy_lints/src/methods/mod.rs | 4 ++-- clippy_lints/src/multiple_bound_locations.rs | 2 +- clippy_lints/src/to_string_trait_impl.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clippy_lints/src/assigning_clones.rs b/clippy_lints/src/assigning_clones.rs index d88ca84fb97d..f0dafb1ae0d5 100644 --- a/clippy_lints/src/assigning_clones.rs +++ b/clippy_lints/src/assigning_clones.rs @@ -45,7 +45,7 @@ declare_clippy_lint! { /// a.clone_from(&b); /// } /// ``` - #[clippy::version = "1.77.0"] + #[clippy::version = "1.78.0"] pub ASSIGNING_CLONES, perf, "assigning the result of cloning may be inefficient" diff --git a/clippy_lints/src/cargo/mod.rs b/clippy_lints/src/cargo/mod.rs index ca7fa4e5a410..593bc6c81ee8 100644 --- a/clippy_lints/src/cargo/mod.rs +++ b/clippy_lints/src/cargo/mod.rs @@ -197,7 +197,7 @@ declare_clippy_lint! { /// pedantic = { level = "warn", priority = -1 } /// similar_names = "allow" /// ``` - #[clippy::version = "1.76.0"] + #[clippy::version = "1.78.0"] pub LINT_GROUPS_PRIORITY, correctness, "a lint group in `Cargo.toml` at the same priority as a lint" diff --git a/clippy_lints/src/casts/mod.rs b/clippy_lints/src/casts/mod.rs index d14898a8196c..bd2c96f01f6f 100644 --- a/clippy_lints/src/casts/mod.rs +++ b/clippy_lints/src/casts/mod.rs @@ -708,7 +708,7 @@ declare_clippy_lint! { /// let a_ref = &1; /// let a_ptr = std::ptr::from_ref(a_ref); /// ``` - #[clippy::version = "1.77.0"] + #[clippy::version = "1.78.0"] pub REF_AS_PTR, pedantic, "using `as` to cast a reference to pointer" diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 16e508bf4e1d..63545d6c5035 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -3993,7 +3993,7 @@ declare_clippy_lint! { /// let x: Result = Ok(0); /// let y = x.unwrap_or_else(|err| handle_error(err)); /// ``` - #[clippy::version = "1.77.0"] + #[clippy::version = "1.78.0"] pub UNNECESSARY_RESULT_MAP_OR_ELSE, suspicious, "making no use of the \"map closure\" when calling `.map_or_else(|err| handle_error(err), |n| n)`" @@ -4027,7 +4027,7 @@ declare_clippy_lint! { /// needs_cstr(c"Hello"); /// unsafe { libc::puts(c"World".as_ptr()) } /// ``` - #[clippy::version = "1.76.0"] + #[clippy::version = "1.78.0"] pub MANUAL_C_STR_LITERALS, pedantic, r#"creating a `CStr` through functions when `c""` literals can be used"# diff --git a/clippy_lints/src/multiple_bound_locations.rs b/clippy_lints/src/multiple_bound_locations.rs index 191b32408efe..d608f3bf7b4d 100644 --- a/clippy_lints/src/multiple_bound_locations.rs +++ b/clippy_lints/src/multiple_bound_locations.rs @@ -29,7 +29,7 @@ declare_clippy_lint! { /// F: Sized + std::fmt::Debug, /// {} /// ``` - #[clippy::version = "1.77.0"] + #[clippy::version = "1.78.0"] pub MULTIPLE_BOUND_LOCATIONS, suspicious, "defining generic bounds in multiple locations" diff --git a/clippy_lints/src/to_string_trait_impl.rs b/clippy_lints/src/to_string_trait_impl.rs index 59ae185c9de7..0361836cdec7 100644 --- a/clippy_lints/src/to_string_trait_impl.rs +++ b/clippy_lints/src/to_string_trait_impl.rs @@ -38,7 +38,7 @@ declare_clippy_lint! { /// } /// } /// ``` - #[clippy::version = "1.77.0"] + #[clippy::version = "1.78.0"] pub TO_STRING_TRAIT_IMPL, style, "check for direct implementations of `ToString`" From 7ac1529ff630eeefb96888d734ae26bb6e84e335 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Mon, 29 Apr 2024 21:44:16 +0200 Subject: [PATCH 2/3] Changelog for Clippy 1.78 :magic_wand: --- CHANGELOG.md | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12d4918ca55e..d908ed43cfae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,75 @@ document. ## Unreleased / Beta / In Rust Nightly -[66c29b97...master](https://github.com/rust-lang/rust-clippy/compare/66c29b97...master) +[93f0a9a9...master](https://github.com/rust-lang/rust-clippy/compare/93f0a9a9...master) + +## Rust 1.78 + +Current stable, released 2024-05-02 + +[View all 112 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-01-26T05%3A46%3A23Z..2024-03-07T16%3A25%3A52Z+base%3Amaster) + +### Important Changes + +* In a few versions, `cargo-clippy` will now no longer ignore the first argument. + Passing in `clippy` as the first argument like cargo does will continue to work. + However, arguments like `--fix` will soon issue a warning and will no longer be. + `cargo clippy` (without `-`!) is unaffected by this change. + [#9461](https://github.com/rust-lang/rust-clippy/pull/9461) + +### New Lints + +* [`assigning_clones`] + [#12077](https://github.com/rust-lang/rust-clippy/pull/12077) +* [`mixed_attributes_style`] + [#12354](https://github.com/rust-lang/rust-clippy/pull/12354) +* [`empty_docs`] + [#12342](https://github.com/rust-lang/rust-clippy/pull/12342) +* [`unnecessary_get_then_check`] + [#12339](https://github.com/rust-lang/rust-clippy/pull/12339) +* [`multiple_bound_locations`] + [#12259](https://github.com/rust-lang/rust-clippy/pull/12259) +* [`unnecessary_clippy_cfg`] + [#12303](https://github.com/rust-lang/rust-clippy/pull/12303) +* [`deprecated_clippy_cfg_attr`] + [#12292](https://github.com/rust-lang/rust-clippy/pull/12292) +* [`manual_c_str_literals`] + [#11919](https://github.com/rust-lang/rust-clippy/pull/11919) +* [`ref_as_ptr`] + [#12087](https://github.com/rust-lang/rust-clippy/pull/12087) +* [`lint_groups_priority`] + [#11832](https://github.com/rust-lang/rust-clippy/pull/11832) +* [`unnecessary_result_map_or_else`] + [#12169](https://github.com/rust-lang/rust-clippy/pull/12169) +* [`to_string_trait_impl`] + [#12122](https://github.com/rust-lang/rust-clippy/pull/12122) +* [`incompatible_msrv`] + [#12160](https://github.com/rust-lang/rust-clippy/pull/12160) + +### Moves and Deprecations + +* Moved [`mixed_attributes_style`] to `style` (Remains warn-by-default) + [#12572](https://github.com/rust-lang/rust-clippy/pull/12572) + +### Enhancements + +* [`thread_local_initializer_can_be_made_const`]: Now checks the [`msrv`] configuration + [#12405](https://github.com/rust-lang/rust-clippy/pull/12405) +* [`disallowed_macros`]: Code generated by derive macros can no longer allow this lint + [#12267](https://github.com/rust-lang/rust-clippy/pull/12267) +* [`wildcard_imports`]: Add configuration [`allowed-wildcard-imports`] to allow preconfigured wildcards + [#11979](https://github.com/rust-lang/rust-clippy/pull/11979) + +### ICE Fixes + +* [`ptr_as_ptr`]: No longer ICEs on types from other crates + [#12617](https://github.com/rust-lang/rust-clippy/pull/12617) +* [`cast_sign_loss`]: Avoids an infinit loop when casting two changed `.unwrap()` calls + [#12508](https://github.com/rust-lang/rust-clippy/pull/12508) ## Rust 1.77 -Current stable, released 2024-03-18 +Released 2024-03-18 [View all 93 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2023-12-16T18%3A20%3A00Z..2024-01-25T18%3A15%3A56Z+base%3Amaster) From 5c23f138dd5217e9b7cef3717540f05d76d7ce3d Mon Sep 17 00:00:00 2001 From: Fridtjof Stoldt Date: Mon, 29 Apr 2024 22:15:05 +0200 Subject: [PATCH 3/3] Apply suggestions from code review <3 Co-authored-by: Timo <30553356+y21@users.noreply.github.com> --- CHANGELOG.md | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d908ed43cfae..9c9ea1140814 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,14 +14,6 @@ Current stable, released 2024-05-02 [View all 112 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-01-26T05%3A46%3A23Z..2024-03-07T16%3A25%3A52Z+base%3Amaster) -### Important Changes - -* In a few versions, `cargo-clippy` will now no longer ignore the first argument. - Passing in `clippy` as the first argument like cargo does will continue to work. - However, arguments like `--fix` will soon issue a warning and will no longer be. - `cargo clippy` (without `-`!) is unaffected by this change. - [#9461](https://github.com/rust-lang/rust-clippy/pull/9461) - ### New Lints * [`assigning_clones`] @@ -51,11 +43,6 @@ Current stable, released 2024-05-02 * [`incompatible_msrv`] [#12160](https://github.com/rust-lang/rust-clippy/pull/12160) -### Moves and Deprecations - -* Moved [`mixed_attributes_style`] to `style` (Remains warn-by-default) - [#12572](https://github.com/rust-lang/rust-clippy/pull/12572) - ### Enhancements * [`thread_local_initializer_can_be_made_const`]: Now checks the [`msrv`] configuration @@ -67,9 +54,9 @@ Current stable, released 2024-05-02 ### ICE Fixes -* [`ptr_as_ptr`]: No longer ICEs on types from other crates +* [`ptr_as_ptr`]: No longer ICEs when the cast source is a function call to a local variable [#12617](https://github.com/rust-lang/rust-clippy/pull/12617) -* [`cast_sign_loss`]: Avoids an infinit loop when casting two changed `.unwrap()` calls +* [`cast_sign_loss`]: Avoids an infinite loop when casting two chained `.unwrap()` calls [#12508](https://github.com/rust-lang/rust-clippy/pull/12508) ## Rust 1.77