From 9e7996b14957421320bbcdb9d4b3f3a65b78b223 Mon Sep 17 00:00:00 2001 From: xFrednet Date: Mon, 31 Oct 2022 21:28:02 +0100 Subject: [PATCH 1/2] Update lint versions for 1.65 --- clippy_lints/src/casts/mod.rs | 2 +- clippy_lints/src/functions/mod.rs | 2 +- clippy_lints/src/manual_instant_elapsed.rs | 2 +- clippy_lints/src/methods/mod.rs | 6 +++--- clippy_lints/src/partialeq_to_none.rs | 2 +- clippy_lints/src/unused_peekable.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clippy_lints/src/casts/mod.rs b/clippy_lints/src/casts/mod.rs index b72c4c772f1c..7148b5e6ebf4 100644 --- a/clippy_lints/src/casts/mod.rs +++ b/clippy_lints/src/casts/mod.rs @@ -593,7 +593,7 @@ declare_clippy_lint! { /// let _: *mut [u8] = std::ptr::slice_from_raw_parts_mut(ptr, len); /// ``` /// [safety requirements]: https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html#safety - #[clippy::version = "1.64.0"] + #[clippy::version = "1.65.0"] pub CAST_SLICE_FROM_RAW_PARTS, suspicious, "casting a slice created from a pointer and length to a slice pointer" diff --git a/clippy_lints/src/functions/mod.rs b/clippy_lints/src/functions/mod.rs index 90911e0bf259..ae0e08334463 100644 --- a/clippy_lints/src/functions/mod.rs +++ b/clippy_lints/src/functions/mod.rs @@ -254,7 +254,7 @@ declare_clippy_lint! { /// Ok(()) /// } /// ``` - #[clippy::version = "1.64.0"] + #[clippy::version = "1.65.0"] pub RESULT_LARGE_ERR, perf, "function returning `Result` with large `Err` type" diff --git a/clippy_lints/src/manual_instant_elapsed.rs b/clippy_lints/src/manual_instant_elapsed.rs index 331cda1db899..1e60aa02d3ca 100644 --- a/clippy_lints/src/manual_instant_elapsed.rs +++ b/clippy_lints/src/manual_instant_elapsed.rs @@ -27,7 +27,7 @@ declare_clippy_lint! { /// let prev_instant = Instant::now(); /// let duration = prev_instant.elapsed(); /// ``` - #[clippy::version = "1.64.0"] + #[clippy::version = "1.65.0"] pub MANUAL_INSTANT_ELAPSED, pedantic, "subtraction between `Instant::now()` and previous `Instant`" diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 6665329d1148..43a52f156809 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -160,7 +160,7 @@ declare_clippy_lint! { /// ```rust /// let hello = "hesuo worpd".replace(&['s', 'u', 'p'], "l"); /// ``` - #[clippy::version = "1.64.0"] + #[clippy::version = "1.65.0"] pub COLLAPSIBLE_STR_REPLACE, perf, "collapse consecutive calls to str::replace (2 or more) into a single call" @@ -2428,7 +2428,7 @@ declare_clippy_lint! { /// ### Known problems /// /// The type of the resulting iterator might become incompatible with its usage - #[clippy::version = "1.64.0"] + #[clippy::version = "1.65.0"] pub ITER_ON_SINGLE_ITEMS, nursery, "Iterator for array of length 1" @@ -2460,7 +2460,7 @@ declare_clippy_lint! { /// ### Known problems /// /// The type of the resulting iterator might become incompatible with its usage - #[clippy::version = "1.64.0"] + #[clippy::version = "1.65.0"] pub ITER_ON_EMPTY_COLLECTIONS, nursery, "Iterator for empty array" diff --git a/clippy_lints/src/partialeq_to_none.rs b/clippy_lints/src/partialeq_to_none.rs index 6810a2431758..456ded3fc026 100644 --- a/clippy_lints/src/partialeq_to_none.rs +++ b/clippy_lints/src/partialeq_to_none.rs @@ -33,7 +33,7 @@ declare_clippy_lint! { /// if f.is_some() { "yay" } else { "nay" } /// } /// ``` - #[clippy::version = "1.64.0"] + #[clippy::version = "1.65.0"] pub PARTIALEQ_TO_NONE, style, "Binary comparison to `Option::None` relies on `T: PartialEq`, which is unneeded" diff --git a/clippy_lints/src/unused_peekable.rs b/clippy_lints/src/unused_peekable.rs index f1cebf0f9923..d086c963c327 100644 --- a/clippy_lints/src/unused_peekable.rs +++ b/clippy_lints/src/unused_peekable.rs @@ -37,7 +37,7 @@ declare_clippy_lint! { /// // ... /// } /// ``` - #[clippy::version = "1.64.0"] + #[clippy::version = "1.65.0"] pub UNUSED_PEEKABLE, nursery, "creating a peekable iterator without using any of its methods" From 30e662d686057da69d7083de85dcc14b66ba726c Mon Sep 17 00:00:00 2001 From: xFrednet Date: Mon, 31 Oct 2022 21:24:26 +0100 Subject: [PATCH 2/2] Changelog for Rust 1.65 :traffic_light: --- CHANGELOG.md | 150 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 147 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b47e80f6979c..3bc1aa9839c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,157 @@ All notable changes to this project will be documented in this file. See [Changelog Update](book/src/development/infrastructure/changelog_update.md) if you want to update this document. -## Unreleased / In Rust Nightly +## Unreleased / Beta / In Rust Nightly -[3c7e7dbc...master](https://github.com/rust-lang/rust-clippy/compare/3c7e7dbc...master) +[b52fb523...master](https://github.com/rust-lang/rust-clippy/compare/b52fb523...master) + +## Rust 1.65 + +Current stable, released 2022-11-03 + +[3c7e7dbc...b52fb523](https://github.com/rust-lang/rust-clippy/compare/3c7e7dbc...b52fb523) + +### Important Changes + +* Clippy now has an `--explain ` command to show the lint description in the console + [#8952](https://github.com/rust-lang/rust-clippy/pull/8952) + +### New Lints + +* [`unused_peekable`] + [#9258](https://github.com/rust-lang/rust-clippy/pull/9258) +* [`collapsible_str_replace`] + [#9269](https://github.com/rust-lang/rust-clippy/pull/9269) +* [`manual_string_new`] + [#9295](https://github.com/rust-lang/rust-clippy/pull/9295) +* [`iter_on_empty_collections`] + [#9187](https://github.com/rust-lang/rust-clippy/pull/9187) +* [`iter_on_single_items`] + [#9187](https://github.com/rust-lang/rust-clippy/pull/9187) +* [`bool_to_int_with_if`] + [#9412](https://github.com/rust-lang/rust-clippy/pull/9412) +* [`multi_assignments`] + [#9379](https://github.com/rust-lang/rust-clippy/pull/9379) +* [`result_large_err`] + [#9373](https://github.com/rust-lang/rust-clippy/pull/9373) +* [`partialeq_to_none`] + [#9288](https://github.com/rust-lang/rust-clippy/pull/9288) +* [`suspicious_to_owned`] + [#8984](https://github.com/rust-lang/rust-clippy/pull/8984) +* [`cast_slice_from_raw_parts`] + [#9247](https://github.com/rust-lang/rust-clippy/pull/9247) +* [`manual_instant_elapsed`] + [#9264](https://github.com/rust-lang/rust-clippy/pull/9264) + +### Moves and Deprecations + +* Moved [`significant_drop_in_scrutinee`] to `nursery` (now allow-by-default) + [#9302](https://github.com/rust-lang/rust-clippy/pull/9302) +* Rename `logic_bug` to [`overly_complex_bool_expr`] + [#9306](https://github.com/rust-lang/rust-clippy/pull/9306) +* Rename `arithmetic` to [`arithmetic_side_effects`] + [#9443](https://github.com/rust-lang/rust-clippy/pull/9443) +* Moved [`only_used_in_recursion`] to complexity (now warn-by-default) + [#8804](https://github.com/rust-lang/rust-clippy/pull/8804) +* Moved [`assertions_on_result_states`] to restriction (now allow-by-default) + [#9273](https://github.com/rust-lang/rust-clippy/pull/9273) +* Renamed `blacklisted_name` to [`disallowed_names`] + [#8974](https://github.com/rust-lang/rust-clippy/pull/8974) + +### Enhancements + +* [`option_if_let_else`]: Now also checks for match expressions + [#8696](https://github.com/rust-lang/rust-clippy/pull/8696) +* [`explicit_auto_deref`]: Now lints on implicit returns in closures + [#9126](https://github.com/rust-lang/rust-clippy/pull/9126) +* [`needless_borrow`]: Now considers trait implementations + [#9136](https://github.com/rust-lang/rust-clippy/pull/9136) +* [`suboptimal_flops`], [`imprecise_flops`]: Now lint on constant expressions + [#9404](https://github.com/rust-lang/rust-clippy/pull/9404) +* [`if_let_mutex`]: Now detects mutex behind references and warns about deadlocks + [#9318](https://github.com/rust-lang/rust-clippy/pull/9318) + +### False Positive Fixes + +* [`unit_arg`] [`default_trait_access`] [`missing_docs_in_private_items`]: No longer + trigger in code generated from proc-macros + [#8694](https://github.com/rust-lang/rust-clippy/pull/8694) +* [`unwrap_used`]: Now lints uses of `unwrap_err` + [#9338](https://github.com/rust-lang/rust-clippy/pull/9338) +* [`expect_used`]: Now lints uses of `expect_err` + [#9338](https://github.com/rust-lang/rust-clippy/pull/9338) +* [`transmute_undefined_repr`]: Now longer lints if the first field is compatible + with the other type + [#9287](https://github.com/rust-lang/rust-clippy/pull/9287) +* [`unnecessary_to_owned`]: No longer lints, if type change cased errors in + the caller function + [#9424](https://github.com/rust-lang/rust-clippy/pull/9424) +* [`match_like_matches_macro`]: No longer lints, if there are comments inside the + match expression + [#9276](https://github.com/rust-lang/rust-clippy/pull/9276) +* [`partialeq_to_none`]: No longer trigger in code generated from macros + [#9389](https://github.com/rust-lang/rust-clippy/pull/9389) +* [`arithmetic_side_effects`]: No longer lints expressions that only use literals + [#9365](https://github.com/rust-lang/rust-clippy/pull/9365) +* [`explicit_auto_deref`]: Now ignores references on block expressions when the type + is `Sized`, on `dyn Trait` returns and when the suggestion is non-trivial + [#9126](https://github.com/rust-lang/rust-clippy/pull/9126) +* [`trait_duplication_in_bounds`]: Now better tracks bounds to avoid false positives + [#9167](https://github.com/rust-lang/rust-clippy/pull/9167) +* [`format_in_format_args`]: Now suggests cases where the result is formatted again + [#9349](https://github.com/rust-lang/rust-clippy/pull/9349) +* [`only_used_in_recursion`]: No longer lints on function without recursions and + takes external functions into account + [#8804](https://github.com/rust-lang/rust-clippy/pull/8804) +* [`missing_const_for_fn`]: No longer lints in proc-macros + [#9308](https://github.com/rust-lang/rust-clippy/pull/9308) +* [`non_ascii_literal`]: Allow non-ascii comments in tests and make sure `#[allow]` + attributes work in tests + [#9327](https://github.com/rust-lang/rust-clippy/pull/9327) +* [`question_mark`]: No longer lint `if let`s with subpatterns + [#9348](https://github.com/rust-lang/rust-clippy/pull/9348) +* [`needless_collect`]: No longer lints in loops + [#8992](https://github.com/rust-lang/rust-clippy/pull/8992) +* [`mut_mutex_lock`]: No longer lints if the mutex is behind an immutable reference + [#9418](https://github.com/rust-lang/rust-clippy/pull/9418) +* [`needless_return`]: Now ignores returns with arguments + [#9381](https://github.com/rust-lang/rust-clippy/pull/9381) +* [`range_plus_one`], [`range_minus_one`]: Now ignores code with macros + [#9446](https://github.com/rust-lang/rust-clippy/pull/9446) +* [`assertions_on_result_states`]: No longer lints on the unit type + [#9273](https://github.com/rust-lang/rust-clippy/pull/9273) + +### Suggestion Fixes/Improvements + +* [`unwrap_or_else_default`]: Now suggests `unwrap_or_default()` for empty strings + [#9421](https://github.com/rust-lang/rust-clippy/pull/9421) +* [`if_then_some_else_none`]: Now also suggests `bool::then_some` + [#9289](https://github.com/rust-lang/rust-clippy/pull/9289) +* [`redundant_closure_call`]: The suggestion now works for async closures + [#9053](https://github.com/rust-lang/rust-clippy/pull/9053) +* [`suboptimal_flops`]: Now suggests parenthesis when they are required + [#9394](https://github.com/rust-lang/rust-clippy/pull/9394) +* [`case_sensitive_file_extension_comparisons`]: Now suggests `map_or(..)` instead of `map(..).unwrap_or` + [#9341](https://github.com/rust-lang/rust-clippy/pull/9341) +* Deprecated configuration values can now be updated automatically + [#9252](https://github.com/rust-lang/rust-clippy/pull/9252) +* [`or_fun_call`]: Now suggest `Entry::or_default` for `Entry::or_insert(Default::default())` + [#9342](https://github.com/rust-lang/rust-clippy/pull/9342) +* [`unwrap_used`]: Only suggests `expect` if [`expect_used`] is allowed + [#9223](https://github.com/rust-lang/rust-clippy/pull/9223) + +### ICE Fixes + +* Fix ICE in [`useless_format`] for literals + [#9406](https://github.com/rust-lang/rust-clippy/pull/9406) +* Fix infinite loop in [`vec_init_then_push`] + [#9441](https://github.com/rust-lang/rust-clippy/pull/9441) +* Fix ICE when reading literals with weird proc-macro spans + [#9303](https://github.com/rust-lang/rust-clippy/pull/9303) ## Rust 1.64 -Current stable, released 2022-09-22 +Released 2022-09-22 [d7b5cbf0...3c7e7dbc](https://github.com/rust-lang/rust-clippy/compare/d7b5cbf0...3c7e7dbc)