Skip to content

Commit

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

r? `@Manishearth`
  • Loading branch information
bors committed Jun 2, 2023
2 parents 8ebf042 + 612c342 commit 0939ec1
Show file tree
Hide file tree
Showing 115 changed files with 3,033 additions and 666 deletions.
74 changes: 62 additions & 12 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ dependencies = [
"serde_json",
"sha2",
"tar",
"toml",
"toml 0.5.7",
"xz2",
]

Expand All @@ -311,7 +311,7 @@ dependencies = [
"indexmap",
"serde",
"serde_json",
"toml",
"toml 0.5.7",
]

[[package]]
Expand Down Expand Up @@ -581,7 +581,7 @@ checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1"

[[package]]
name = "clippy"
version = "0.1.71"
version = "0.1.72"
dependencies = [
"clap 4.2.1",
"clippy_lints",
Expand All @@ -596,15 +596,14 @@ dependencies = [
"quote",
"regex",
"rustc-semver",
"rustc-workspace-hack",
"rustc_tools_util",
"serde",
"syn 2.0.8",
"tempfile",
"termize",
"tester",
"tokio",
"toml",
"toml 0.7.4",
"walkdir",
]

Expand All @@ -623,7 +622,7 @@ dependencies = [

[[package]]
name = "clippy_lints"
version = "0.1.71"
version = "0.1.72"
dependencies = [
"arrayvec",
"cargo_metadata 0.15.3",
Expand All @@ -639,15 +638,15 @@ dependencies = [
"serde",
"serde_json",
"tempfile",
"toml",
"toml 0.7.4",
"unicode-normalization",
"unicode-script",
"url",
]

[[package]]
name = "clippy_utils"
version = "0.1.71"
version = "0.1.72"
dependencies = [
"arrayvec",
"if_chain",
Expand Down Expand Up @@ -930,7 +929,7 @@ checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69"

[[package]]
name = "declare_clippy_lint"
version = "0.1.71"
version = "0.1.72"
dependencies = [
"itertools",
"quote",
Expand Down Expand Up @@ -2111,7 +2110,7 @@ dependencies = [
"serde_json",
"shlex",
"tempfile",
"toml",
"toml 0.5.7",
"topological-sort",
]

Expand Down Expand Up @@ -4363,7 +4362,7 @@ dependencies = [
"serde_json",
"term",
"thiserror",
"toml",
"toml 0.5.7",
"unicode-segmentation",
"unicode-width",
"unicode_categories",
Expand Down Expand Up @@ -4484,6 +4483,15 @@ dependencies = [
"serde",
]

[[package]]
name = "serde_spanned"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d"
dependencies = [
"serde",
]

[[package]]
name = "sha1"
version = "0.10.5"
Expand Down Expand Up @@ -4995,6 +5003,40 @@ dependencies = [
"serde",
]

[[package]]
name = "toml"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"toml_edit",
]

[[package]]
name = "toml_datetime"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f"
dependencies = [
"serde",
]

[[package]]
name = "toml_edit"
version = "0.19.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739"
dependencies = [
"indexmap",
"serde",
"serde_spanned",
"toml_datetime",
"winnow",
]

[[package]]
name = "topological-sort"
version = "0.2.2"
Expand Down Expand Up @@ -5358,7 +5400,6 @@ dependencies = [
"idna",
"matches",
"percent-encoding",
"serde",
]

[[package]]
Expand Down Expand Up @@ -5685,6 +5726,15 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"

[[package]]
name = "winnow"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699"
dependencies = [
"memchr",
]

[[package]]
name = "writeable"
version = "0.5.1"
Expand Down
23 changes: 0 additions & 23 deletions src/tools/clippy/.github/ISSUE_TEMPLATE/new_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,6 @@ body:
description: What does this lint do?
validations:
required: true
- type: input
id: lint-name
attributes:
label: Lint Name
description: Please provide the lint name.
- type: dropdown
id: category
attributes:
label: Category
description: >
What category should this lint go into? If you're unsure you can select
multiple categories. You can find a category description in the
`README`.
multiple: true
options:
- correctness
- suspicious
- style
- complexity
- perf
- pedantic
- restriction
- cargo
- type: textarea
id: advantage
attributes:
Expand Down
130 changes: 129 additions & 1 deletion src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,132 @@ document.

## Unreleased / Beta / In Rust Nightly

[149392b0...master](https://github.com/rust-lang/rust-clippy/compare/149392b0...master)
[83e42a23...master](https://github.com/rust-lang/rust-clippy/compare/83e42a23...master)

## Rust 1.70

Current beta, released 2023-06-01

[149392b0...83e42a23](https://github.com/rust-lang/rust-clippy/compare/149392b0...83e42a23)

### New Lints

* [`large_futures`]
[#10414](https://github.com/rust-lang/rust-clippy/pull/10414)
* [`missing_assert_message`]
[#10362](https://github.com/rust-lang/rust-clippy/pull/10362)
* [`clear_with_drain`]
[#10528](https://github.com/rust-lang/rust-clippy/pull/10528)
* [`redundant_async_block`]
[#10448](https://github.com/rust-lang/rust-clippy/pull/10448)
* [`collection_is_never_read`]
[#10415](https://github.com/rust-lang/rust-clippy/pull/10415)
* [`let_with_type_underscore`]
[#10467](https://github.com/rust-lang/rust-clippy/pull/10467)
* [`tests_outside_test_module`]
[#10543](https://github.com/rust-lang/rust-clippy/pull/10543)
* [`allow_attributes`]
[#10481](https://github.com/rust-lang/rust-clippy/pull/10481)
* [`suspicious_doc_comments`]
[#10497](https://github.com/rust-lang/rust-clippy/pull/10497)
* [`unnecessary_box_returns`]
[#9102](https://github.com/rust-lang/rust-clippy/pull/9102)
* [`manual_main_separator_str`]
[#10483](https://github.com/rust-lang/rust-clippy/pull/10483)
* [`unnecessary_struct_initialization`]
[#10489](https://github.com/rust-lang/rust-clippy/pull/10489)
* [`manual_slice_size_calculation`]
[#10601](https://github.com/rust-lang/rust-clippy/pull/10601)
* [`lines_filter_map_ok`]
[#10534](https://github.com/rust-lang/rust-clippy/pull/10534)

### Moves and Deprecations

* Moved [`let_underscore_untyped`] to `restriction`
[#10442](https://github.com/rust-lang/rust-clippy/pull/10442)

### Enhancements

* [`extra_unused_type_parameters`]: No longer lints on public items if `avoid-breaking-exported-api` is set
[#10536](https://github.com/rust-lang/rust-clippy/pull/10536)
* [`len_without_is_empty`]: Now also detects `async` functions
[#10359](https://github.com/rust-lang/rust-clippy/pull/10359)
* [`arithmetic_side_effects`]: Now correctly handles divisions and modulo expressions if the right-hand-side
is unknown
[#10585](https://github.com/rust-lang/rust-clippy/pull/10585)
* [`nonminimal_bool`]: No longer ignores `#[allow]` attributes
[#10588](https://github.com/rust-lang/rust-clippy/pull/10588)
* [`uninit_vec`], [`uninit_assumed_init`]: Now uses a better heuristic
[#10520](https://github.com/rust-lang/rust-clippy/pull/10520)
* [`ifs_same_cond`]: Now also detects immutable method calls.
[#10350](https://github.com/rust-lang/rust-clippy/pull/10350)
* [`arithmetic_side_effects`]: No longer lints on right or left shifts with constant integers, as the
compiler warns about them
[#10309](https://github.com/rust-lang/rust-clippy/pull/10309)
* [`items_after_statements`]: `#[allow(items_after_statements)]` now works on items
[#10542](https://github.com/rust-lang/rust-clippy/pull/10542)
* [`significant_drop_tightening`]: Was optimized
[#10533](https://github.com/rust-lang/rust-clippy/pull/10533)

### False Positive Fixes

* [`single_component_path_imports`]: No longer lints if the import is used relative to `self`
[#10566](https://github.com/rust-lang/rust-clippy/pull/10566)
* [`derivable_impls`]: No longer suggests deriving `Default` on generics with implicit arguments
[#10399](https://github.com/rust-lang/rust-clippy/pull/10399)
* [`let_unit_value`]: No longer lints if the expression contains an `await`
[#10439](https://github.com/rust-lang/rust-clippy/pull/10439)
* [`double_must_use`]: Now ignores `async` functions
[#10589](https://github.com/rust-lang/rust-clippy/pull/10589)
* [`manual_clamp`]: No longer lints in constant context
[#10479](https://github.com/rust-lang/rust-clippy/pull/10479)
* [`almost_swapped`]: Now ignores external macros
[#10502](https://github.com/rust-lang/rust-clippy/pull/10502)
* [`nonminimal_bool`]: Now ignores macros
[#10527](https://github.com/rust-lang/rust-clippy/pull/10527)
* [`needless_return`]: No longer lints match statements with incompatible branches
[#10593](https://github.com/rust-lang/rust-clippy/pull/10593)
* [`use_self`]: Do not suggest using `Self` in const generic parameters
[#10375](https://github.com/rust-lang/rust-clippy/pull/10375)
* [`mem_replace_option_with_none`]: No longer lints on field expressions
[#10594](https://github.com/rust-lang/rust-clippy/pull/10594)
* [`items_after_statements`]: No longer lints on times from macros
[#10542](https://github.com/rust-lang/rust-clippy/pull/10542)
* [`print_literal`], [`write_literal`]: No longer lint strings coming from the `file!()` macro
[#10573](https://github.com/rust-lang/rust-clippy/pull/10573)
* [`uninit_vec`], [`uninit_assumed_init`]: Now check the types inside arrays and tuples
[#10553](https://github.com/rust-lang/rust-clippy/pull/10553)
* [`almost_swapped`]: No longer lints if a variable is assigned to itself
[#10499](https://github.com/rust-lang/rust-clippy/pull/10499)
* [`missing_docs_in_private_items`]: No longer lints on public items
[#10324](https://github.com/rust-lang/rust-clippy/pull/10324)

### Suggestion Fixes/Improvements

* [`extra_unused_type_parameters`]: The suggestion is now machine applicable
[#10536](https://github.com/rust-lang/rust-clippy/pull/10536)
* [`match_single_binding`]: Now adds a semicolon after the suggestion
[#10470](https://github.com/rust-lang/rust-clippy/pull/10470)
* [`missing_const_for_fn`]: Now includes a note if the change could break compatibility
[#10618](https://github.com/rust-lang/rust-clippy/pull/10618)
* [`cast_possible_truncation`]: Corrected suggestion for float and wildcard casts
[#10496](https://github.com/rust-lang/rust-clippy/pull/10496)
* [`transmutes_expressible_as_ptr_casts`]: The suggestion now includes parentheses when they are required
[#10454](https://github.com/rust-lang/rust-clippy/pull/10454)

### ICE Fixes

* [`needless_borrow`]: No longer panics on ambiguous projections
[#10403](https://github.com/rust-lang/rust-clippy/pull/10403)
* [`multiple_unsafe_ops_per_block`]: Fix ICE when calling a function-like object in an unsafe block
[#10405](https://github.com/rust-lang/rust-clippy/pull/10405)

### Others

* `clippy-driver` now searches parent directories for `clippy.toml` files
[#10592](https://github.com/rust-lang/rust-clippy/pull/10592)
* Fixed a deserialization error for the `array-size-threshold` config value
[#10423](https://github.com/rust-lang/rust-clippy/pull/10423)

## Rust 1.69

Expand Down Expand Up @@ -4838,6 +4963,7 @@ Released 2018-09-13
[`missing_docs_in_private_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
[`missing_enforced_import_renames`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_enforced_import_renames
[`missing_errors_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
[`missing_fields_in_debug`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_fields_in_debug
[`missing_inline_in_public_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
[`missing_panics_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
[`missing_safety_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
Expand Down Expand Up @@ -4874,6 +5000,7 @@ Released 2018-09-13
[`needless_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect
[`needless_continue`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_continue
[`needless_doctest_main`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
[`needless_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_else
[`needless_for_each`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_for_each
[`needless_late_init`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
[`needless_lifetimes`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
Expand Down Expand Up @@ -4949,6 +5076,7 @@ Released 2018-09-13
[`println_empty_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string
[`ptr_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
[`ptr_as_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
[`ptr_cast_constness`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness
[`ptr_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq
[`ptr_offset_with_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
[`pub_enum_variant_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#pub_enum_variant_names
Expand Down
9 changes: 2 additions & 7 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.71"
version = "0.1.72"
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 Expand Up @@ -30,16 +30,11 @@ termize = "0.1"
compiletest_rs = { version = "0.10", features = ["tmp"] }
tester = "0.9"
regex = "1.5"
toml = "0.5"
toml = "0.7.3"
walkdir = "2.3"
# This is used by the `collect-metadata` alias.
filetime = "0.2"

# A noop dependency that changes in the Rust repository, it's a bit of a hack.
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
# for more information.
rustc-workspace-hack = "1.0"

# UI test dependencies
clap = { version = "4.1.4", features = ["derive"] }
clippy_utils = { path = "clippy_utils" }
Expand Down
Loading

0 comments on commit 0939ec1

Please sign in to comment.