Skip to content

Commit

Permalink
Auto merge of #105827 - flip1995:clippyup, r=matthiaskrgr
Browse files Browse the repository at this point in the history
Update Clippy

r? `@Manishearth`
  • Loading branch information
bors committed Dec 17, 2022
2 parents 65c53c3 + 10f2a6d commit 2d76a9d
Show file tree
Hide file tree
Showing 128 changed files with 2,719 additions and 608 deletions.
18 changes: 12 additions & 6 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ dependencies = [
"directories",
"rustc-build-sysroot",
"rustc-workspace-hack",
"rustc_tools_util",
"rustc_tools_util 0.2.1",
"rustc_version",
"serde",
"serde_json",
Expand Down Expand Up @@ -658,7 +658,7 @@ dependencies = [

[[package]]
name = "clippy"
version = "0.1.67"
version = "0.1.68"
dependencies = [
"clippy_lints",
"clippy_utils",
Expand All @@ -673,7 +673,7 @@ dependencies = [
"regex",
"rustc-semver",
"rustc-workspace-hack",
"rustc_tools_util",
"rustc_tools_util 0.3.0",
"semver",
"serde",
"syn",
Expand All @@ -700,7 +700,7 @@ dependencies = [

[[package]]
name = "clippy_lints"
version = "0.1.67"
version = "0.1.68"
dependencies = [
"cargo_metadata 0.14.0",
"clippy_utils",
Expand All @@ -723,7 +723,7 @@ dependencies = [

[[package]]
name = "clippy_utils"
version = "0.1.67"
version = "0.1.68"
dependencies = [
"arrayvec",
"if_chain",
Expand Down Expand Up @@ -1068,7 +1068,7 @@ checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69"

[[package]]
name = "declare_clippy_lint"
version = "0.1.67"
version = "0.1.68"
dependencies = [
"itertools",
"quote",
Expand Down Expand Up @@ -4429,6 +4429,12 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "598f48ce2a421542b3e64828aa742b687cc1b91d2f96591cfdb7ac5988cd6366"

[[package]]
name = "rustc_tools_util"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ba09476327c4b70ccefb6180f046ef588c26a24cf5d269a9feba316eb4f029f"

[[package]]
name = "rustc_trait_selection"
version = "0.0.0"
Expand Down
7 changes: 0 additions & 7 deletions src/tools/clippy/.github/workflows/clippy_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ jobs:
with:
github_token: "${{ secrets.github_token }}"

- name: Install dependencies (Linux-i686)
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install gcc-multilib libssl-dev:i386 libgit2-dev:i386
if: matrix.host == 'i686-unknown-linux-gnu'

- name: Checkout
uses: actions/[email protected]

Expand Down
177 changes: 175 additions & 2 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,181 @@ document.

## Unreleased / Beta / In Rust Nightly

[b52fb523...master](https://github.com/rust-lang/rust-clippy/compare/b52fb523...master)
[4f142aa1...master](https://github.com/rust-lang/rust-clippy/compare/4f142aa1...master)

## Rust 1.66

Current stable, released 2022-12-15

[b52fb523...4f142aa1](https://github.com/rust-lang/rust-clippy/compare/b52fb523...4f142aa1)

### New Lints

* [`manual_clamp`]
[#9484](https://github.com/rust-lang/rust-clippy/pull/9484)
* [`missing_trait_methods`]
[#9670](https://github.com/rust-lang/rust-clippy/pull/9670)
* [`unused_format_specs`]
[#9637](https://github.com/rust-lang/rust-clippy/pull/9637)
* [`iter_kv_map`]
[#9409](https://github.com/rust-lang/rust-clippy/pull/9409)
* [`manual_filter`]
[#9451](https://github.com/rust-lang/rust-clippy/pull/9451)
* [`box_default`]
[#9511](https://github.com/rust-lang/rust-clippy/pull/9511)
* [`implicit_saturating_add`]
[#9549](https://github.com/rust-lang/rust-clippy/pull/9549)
* [`as_ptr_cast_mut`]
[#9572](https://github.com/rust-lang/rust-clippy/pull/9572)
* [`disallowed_macros`]
[#9495](https://github.com/rust-lang/rust-clippy/pull/9495)
* [`partial_pub_fields`]
[#9658](https://github.com/rust-lang/rust-clippy/pull/9658)
* [`uninlined_format_args`]
[#9233](https://github.com/rust-lang/rust-clippy/pull/9233)
* [`cast_nan_to_int`]
[#9617](https://github.com/rust-lang/rust-clippy/pull/9617)

### Moves and Deprecations

* `positional_named_format_parameters` was uplifted to rustc under the new name
`named_arguments_used_positionally`
[#8518](https://github.com/rust-lang/rust-clippy/pull/8518)
* Moved [`implicit_saturating_sub`] to `style` (Now warn-by-default)
[#9584](https://github.com/rust-lang/rust-clippy/pull/9584)
* Moved `derive_partial_eq_without_eq` to `nursery` (now allow-by-default)
[#9536](https://github.com/rust-lang/rust-clippy/pull/9536)

### Enhancements

* [`nonstandard_macro_braces`]: Now includes `matches!()` in the default lint config
[#9471](https://github.com/rust-lang/rust-clippy/pull/9471)
* [`suboptimal_flops`]: Now supports multiplication and subtraction operations
[#9581](https://github.com/rust-lang/rust-clippy/pull/9581)
* [`arithmetic_side_effects`]: Now detects cases with literals behind references
[#9587](https://github.com/rust-lang/rust-clippy/pull/9587)
* [`upper_case_acronyms`]: Now also checks enum names
[#9580](https://github.com/rust-lang/rust-clippy/pull/9580)
* [`needless_borrowed_reference`]: Now lints nested patterns
[#9573](https://github.com/rust-lang/rust-clippy/pull/9573)
* [`unnecessary_cast`]: Now works for non-trivial non-literal expressions
[#9576](https://github.com/rust-lang/rust-clippy/pull/9576)
* [`arithmetic_side_effects`]: Now detects operations with custom types
[#9559](https://github.com/rust-lang/rust-clippy/pull/9559)
* [`disallowed_methods`], [`disallowed_types`]: Not correctly lints types, functions and macros
with the same path
[#9495](https://github.com/rust-lang/rust-clippy/pull/9495)
* [`self_named_module_files`], [`mod_module_files`]: Now take remapped path prefixes into account
[#9475](https://github.com/rust-lang/rust-clippy/pull/9475)
* [`bool_to_int_with_if`]: Now detects the inverse if case
[#9476](https://github.com/rust-lang/rust-clippy/pull/9476)

### False Positive Fixes

* [`arithmetic_side_effects`]: Now allows operations that can't overflow
[#9474](https://github.com/rust-lang/rust-clippy/pull/9474)
* [`unnecessary_lazy_evaluations`]: No longer lints in external macros
[#9486](https://github.com/rust-lang/rust-clippy/pull/9486)
* [`needless_borrow`], [`explicit_auto_deref`]: No longer lint on unions that require the reference
[#9490](https://github.com/rust-lang/rust-clippy/pull/9490)
* [`almost_complete_letter_range`]: No longer lints in external macros
[#9467](https://github.com/rust-lang/rust-clippy/pull/9467)
* [`drop_copy`]: No longer lints on idiomatic cases in match arms
[#9491](https://github.com/rust-lang/rust-clippy/pull/9491)
* [`question_mark`]: No longer lints in const context
[#9487](https://github.com/rust-lang/rust-clippy/pull/9487)
* [`collapsible_if`]: Suggestion now work in macros
[#9410](https://github.com/rust-lang/rust-clippy/pull/9410)
* [`std_instead_of_core`]: No longer triggers on unstable modules
[#9545](https://github.com/rust-lang/rust-clippy/pull/9545)
* [`unused_peekable`]: No longer lints, if the peak is done in a closure or function
[#9465](https://github.com/rust-lang/rust-clippy/pull/9465)
* [`useless_attribute`]: No longer lints on `#[allow]` attributes for [`unsafe_removed_from_name`]
[#9593](https://github.com/rust-lang/rust-clippy/pull/9593)
* [`unnecessary_lazy_evaluations`]: No longer suggest switching to early evaluation when type has
custom `Drop` implementation
[#9551](https://github.com/rust-lang/rust-clippy/pull/9551)
* [`unnecessary_cast`]: No longer lints on negative hexadecimal literals when cast as floats
[#9609](https://github.com/rust-lang/rust-clippy/pull/9609)
* [`use_self`]: No longer lints in proc macros
[#9454](https://github.com/rust-lang/rust-clippy/pull/9454)
* [`never_loop`]: Now takes `let ... else` statements into consideration.
[#9496](https://github.com/rust-lang/rust-clippy/pull/9496)
* [`default_numeric_fallback`]: Now ignores constants
[#9636](https://github.com/rust-lang/rust-clippy/pull/9636)
* [`uninit_vec`]: No longer lints `Vec::set_len(0)`
[#9519](https://github.com/rust-lang/rust-clippy/pull/9519)
* [`arithmetic_side_effects`]: Now ignores references to integer types
[#9507](https://github.com/rust-lang/rust-clippy/pull/9507)
* [`large_stack_arrays`]: No longer lints inside static items
[#9466](https://github.com/rust-lang/rust-clippy/pull/9466)
* [`ref_option_ref`]: No longer lints if the inner reference is mutable
[#9684](https://github.com/rust-lang/rust-clippy/pull/9684)
* [`ptr_arg`]: No longer lints if the argument is used as an incomplete trait object
[#9645](https://github.com/rust-lang/rust-clippy/pull/9645)
* [`should_implement_trait`]: Now also works for `default` methods
[#9546](https://github.com/rust-lang/rust-clippy/pull/9546)

### Suggestion Fixes/Improvements

* [`derivable_impls`]: The suggestion is now machine applicable
[#9429](https://github.com/rust-lang/rust-clippy/pull/9429)
* [`match_single_binding`]: The suggestion now handles scrutinies with side effects better
[#9601](https://github.com/rust-lang/rust-clippy/pull/9601)
* [`zero_prefixed_literal`]: Only suggests using octal numbers, if this is possible
[#9652](https://github.com/rust-lang/rust-clippy/pull/9652)
* [`rc_buffer`]: The suggestion is no longer machine applicable to avoid semantic changes
[#9633](https://github.com/rust-lang/rust-clippy/pull/9633)
* [`print_literal`], [`write_literal`], [`uninlined_format_args`]: The suggestion now ignores
comments after the macro call.
[#9586](https://github.com/rust-lang/rust-clippy/pull/9586)
* [`expect_fun_call`]:Improved the suggestion for `format!` calls with captured variables
[#9586](https://github.com/rust-lang/rust-clippy/pull/9586)
* [`nonstandard_macro_braces`]: The suggestion is now machine applicable and will no longer
replace brackets inside the macro argument.
[#9499](https://github.com/rust-lang/rust-clippy/pull/9499)
* [`from_over_into`]: The suggestion is now a machine applicable and contains explanations
[#9649](https://github.com/rust-lang/rust-clippy/pull/9649)
* [`needless_return`]: The automatic suggestion now removes all required semicolons
[#9497](https://github.com/rust-lang/rust-clippy/pull/9497)
* [`to_string_in_format_args`]: The suggestion now keeps parenthesis around values
[#9590](https://github.com/rust-lang/rust-clippy/pull/9590)
* [`manual_assert`]: The suggestion now preserves comments
[#9479](https://github.com/rust-lang/rust-clippy/pull/9479)
* [`redundant_allocation`]: The suggestion applicability is now marked `MaybeIncorrect` to
avoid semantic changes
[#9634](https://github.com/rust-lang/rust-clippy/pull/9634)
* [`assertions_on_result_states`]: The suggestion has been corrected, for cases where the
`assert!` is not in a statement.
[#9453](https://github.com/rust-lang/rust-clippy/pull/9453)
* [`nonminimal_bool`]: The suggestion no longer expands macros
[#9457](https://github.com/rust-lang/rust-clippy/pull/9457)
* [`collapsible_match`]: Now specifies field names, when a struct is destructed
[#9685](https://github.com/rust-lang/rust-clippy/pull/9685)
* [`unnecessary_cast`]: The suggestion now adds parenthesis for negative numbers
[#9577](https://github.com/rust-lang/rust-clippy/pull/9577)
* [`redundant_closure`]: The suggestion now works for `impl FnMut` arguments
[#9556](https://github.com/rust-lang/rust-clippy/pull/9556)

### ICE Fixes

* [`unnecessary_to_owned`]: Avoid ICEs in favor of false negatives if information is missing
[#9505](https://github.com/rust-lang/rust-clippy/pull/9505)
* [`manual_range_contains`]: No longer ICEs on values behind references
[#9627](https://github.com/rust-lang/rust-clippy/pull/9627)
* [`needless_pass_by_value`]: No longer ICEs on unsized `dyn Fn` arguments
[#9531](https://github.com/rust-lang/rust-clippy/pull/9531)
* `*_interior_mutable_const` lints: no longer ICE on const unions containing `!Freeze` types
[#9539](https://github.com/rust-lang/rust-clippy/pull/9539)

### Others

* Released `rustc_tools_util` for version information on `Crates.io`. (Further adjustments will
not be published as part of this changelog)

## Rust 1.65

Current stable, released 2022-11-03
Released 2022-11-03

[3c7e7dbc...b52fb523](https://github.com/rust-lang/rust-clippy/compare/3c7e7dbc...b52fb523)

Expand Down Expand Up @@ -3875,6 +4045,7 @@ Released 2018-09-13
[`alloc_instead_of_core`]: https://rust-lang.github.io/rust-clippy/master/index.html#alloc_instead_of_core
[`allow_attributes_without_reason`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes_without_reason
[`almost_complete_letter_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_letter_range
[`almost_complete_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_range
[`almost_swapped`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_swapped
[`approx_constant`]: https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant
[`arithmetic_side_effects`]: https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
Expand Down Expand Up @@ -4353,6 +4524,8 @@ Released 2018-09-13
[`self_named_constructors`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors
[`self_named_module_files`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_module_files
[`semicolon_if_nothing_returned`]: https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
[`semicolon_inside_block`]: https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_inside_block
[`semicolon_outside_block`]: https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_outside_block
[`separated_literal_suffix`]: https://rust-lang.github.io/rust-clippy/master/index.html#separated_literal_suffix
[`serde_api_misuse`]: https://rust-lang.github.io/rust-clippy/master/index.html#serde_api_misuse
[`shadow_reuse`]: https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
Expand Down
6 changes: 3 additions & 3 deletions src/tools/clippy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.1.67"
version = "0.1.68"
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand All @@ -23,7 +23,7 @@ path = "src/driver.rs"
[dependencies]
clippy_lints = { path = "clippy_lints" }
semver = "1.0"
rustc_tools_util = "0.2.1"
rustc_tools_util = "0.3.0"
tempfile = { version = "3.2", optional = true }
termize = "0.1"

Expand Down Expand Up @@ -55,7 +55,7 @@ tokio = { version = "1", features = ["io-util"] }
rustc-semver = "1.1"

[build-dependencies]
rustc_tools_util = "0.2.1"
rustc_tools_util = "0.3.0"

[features]
deny-warnings = ["clippy_lints/deny-warnings"]
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Clippy

[![Clippy Test](https://github.com/rust-lang/rust-clippy/workflows/Clippy%20Test/badge.svg?branch=auto&event=push)](https://github.com/rust-lang/rust-clippy/actions?query=workflow%3A%22Clippy+Test%22+event%3Apush+branch%3Aauto)
[![Clippy Test](https://github.com/rust-lang/rust-clippy/workflows/Clippy%20Test%20(bors)/badge.svg?branch=auto&event=push)](https://github.com/rust-lang/rust-clippy/actions?query=workflow%3A%22Clippy+Test+(bors)%22+event%3Apush+branch%3Aauto)
[![License: MIT OR Apache-2.0](https://img.shields.io/crates/l/clippy.svg)](https://github.com/rust-lang/rust-clippy#license)

A collection of lints to catch common mistakes and improve your
Expand Down
14 changes: 1 addition & 13 deletions src/tools/clippy/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,5 @@ fn main() {
println!("cargo:rustc-env=PROFILE={}", std::env::var("PROFILE").unwrap());
// Don't rebuild even if nothing changed
println!("cargo:rerun-if-changed=build.rs");
// forward git repo hashes we build at
println!(
"cargo:rustc-env=GIT_HASH={}",
rustc_tools_util::get_commit_hash().unwrap_or_default()
);
println!(
"cargo:rustc-env=COMMIT_DATE={}",
rustc_tools_util::get_commit_date().unwrap_or_default()
);
println!(
"cargo:rustc-env=RUSTC_RELEASE_CHANNEL={}",
rustc_tools_util::get_channel()
);
rustc_tools_util::setup_version_info!();
}
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy_lints"
version = "0.1.67"
version = "0.1.68"
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand Down
Loading

0 comments on commit 2d76a9d

Please sign in to comment.