Skip to content

Commit 0939ec1

Browse files
committed
Auto merge of #112203 - flip1995:clippyup, r=Manishearth
Update Clippy r? `@Manishearth`
2 parents 8ebf042 + 612c342 commit 0939ec1

File tree

115 files changed

+3033
-666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+3033
-666
lines changed

Diff for: Cargo.lock

+62-12
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ dependencies = [
294294
"serde_json",
295295
"sha2",
296296
"tar",
297-
"toml",
297+
"toml 0.5.7",
298298
"xz2",
299299
]
300300

@@ -311,7 +311,7 @@ dependencies = [
311311
"indexmap",
312312
"serde",
313313
"serde_json",
314-
"toml",
314+
"toml 0.5.7",
315315
]
316316

317317
[[package]]
@@ -581,7 +581,7 @@ checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1"
581581

582582
[[package]]
583583
name = "clippy"
584-
version = "0.1.71"
584+
version = "0.1.72"
585585
dependencies = [
586586
"clap 4.2.1",
587587
"clippy_lints",
@@ -596,15 +596,14 @@ dependencies = [
596596
"quote",
597597
"regex",
598598
"rustc-semver",
599-
"rustc-workspace-hack",
600599
"rustc_tools_util",
601600
"serde",
602601
"syn 2.0.8",
603602
"tempfile",
604603
"termize",
605604
"tester",
606605
"tokio",
607-
"toml",
606+
"toml 0.7.4",
608607
"walkdir",
609608
]
610609

@@ -623,7 +622,7 @@ dependencies = [
623622

624623
[[package]]
625624
name = "clippy_lints"
626-
version = "0.1.71"
625+
version = "0.1.72"
627626
dependencies = [
628627
"arrayvec",
629628
"cargo_metadata 0.15.3",
@@ -639,15 +638,15 @@ dependencies = [
639638
"serde",
640639
"serde_json",
641640
"tempfile",
642-
"toml",
641+
"toml 0.7.4",
643642
"unicode-normalization",
644643
"unicode-script",
645644
"url",
646645
]
647646

648647
[[package]]
649648
name = "clippy_utils"
650-
version = "0.1.71"
649+
version = "0.1.72"
651650
dependencies = [
652651
"arrayvec",
653652
"if_chain",
@@ -930,7 +929,7 @@ checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69"
930929

931930
[[package]]
932931
name = "declare_clippy_lint"
933-
version = "0.1.71"
932+
version = "0.1.72"
934933
dependencies = [
935934
"itertools",
936935
"quote",
@@ -2111,7 +2110,7 @@ dependencies = [
21112110
"serde_json",
21122111
"shlex",
21132112
"tempfile",
2114-
"toml",
2113+
"toml 0.5.7",
21152114
"topological-sort",
21162115
]
21172116

@@ -4363,7 +4362,7 @@ dependencies = [
43634362
"serde_json",
43644363
"term",
43654364
"thiserror",
4366-
"toml",
4365+
"toml 0.5.7",
43674366
"unicode-segmentation",
43684367
"unicode-width",
43694368
"unicode_categories",
@@ -4484,6 +4483,15 @@ dependencies = [
44844483
"serde",
44854484
]
44864485

4486+
[[package]]
4487+
name = "serde_spanned"
4488+
version = "0.6.2"
4489+
source = "registry+https://github.com/rust-lang/crates.io-index"
4490+
checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d"
4491+
dependencies = [
4492+
"serde",
4493+
]
4494+
44874495
[[package]]
44884496
name = "sha1"
44894497
version = "0.10.5"
@@ -4995,6 +5003,40 @@ dependencies = [
49955003
"serde",
49965004
]
49975005

5006+
[[package]]
5007+
name = "toml"
5008+
version = "0.7.4"
5009+
source = "registry+https://github.com/rust-lang/crates.io-index"
5010+
checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec"
5011+
dependencies = [
5012+
"serde",
5013+
"serde_spanned",
5014+
"toml_datetime",
5015+
"toml_edit",
5016+
]
5017+
5018+
[[package]]
5019+
name = "toml_datetime"
5020+
version = "0.6.2"
5021+
source = "registry+https://github.com/rust-lang/crates.io-index"
5022+
checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f"
5023+
dependencies = [
5024+
"serde",
5025+
]
5026+
5027+
[[package]]
5028+
name = "toml_edit"
5029+
version = "0.19.10"
5030+
source = "registry+https://github.com/rust-lang/crates.io-index"
5031+
checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739"
5032+
dependencies = [
5033+
"indexmap",
5034+
"serde",
5035+
"serde_spanned",
5036+
"toml_datetime",
5037+
"winnow",
5038+
]
5039+
49985040
[[package]]
49995041
name = "topological-sort"
50005042
version = "0.2.2"
@@ -5358,7 +5400,6 @@ dependencies = [
53585400
"idna",
53595401
"matches",
53605402
"percent-encoding",
5361-
"serde",
53625403
]
53635404

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

5729+
[[package]]
5730+
name = "winnow"
5731+
version = "0.4.6"
5732+
source = "registry+https://github.com/rust-lang/crates.io-index"
5733+
checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699"
5734+
dependencies = [
5735+
"memchr",
5736+
]
5737+
56885738
[[package]]
56895739
name = "writeable"
56905740
version = "0.5.1"

Diff for: src/tools/clippy/.github/ISSUE_TEMPLATE/new_lint.yml

-23
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,6 @@ body:
1212
description: What does this lint do?
1313
validations:
1414
required: true
15-
- type: input
16-
id: lint-name
17-
attributes:
18-
label: Lint Name
19-
description: Please provide the lint name.
20-
- type: dropdown
21-
id: category
22-
attributes:
23-
label: Category
24-
description: >
25-
What category should this lint go into? If you're unsure you can select
26-
multiple categories. You can find a category description in the
27-
`README`.
28-
multiple: true
29-
options:
30-
- correctness
31-
- suspicious
32-
- style
33-
- complexity
34-
- perf
35-
- pedantic
36-
- restriction
37-
- cargo
3815
- type: textarea
3916
id: advantage
4017
attributes:

Diff for: src/tools/clippy/CHANGELOG.md

+129-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,132 @@ document.
66

77
## Unreleased / Beta / In Rust Nightly
88

9-
[149392b0...master](https://github.com/rust-lang/rust-clippy/compare/149392b0...master)
9+
[83e42a23...master](https://github.com/rust-lang/rust-clippy/compare/83e42a23...master)
10+
11+
## Rust 1.70
12+
13+
Current beta, released 2023-06-01
14+
15+
[149392b0...83e42a23](https://github.com/rust-lang/rust-clippy/compare/149392b0...83e42a23)
16+
17+
### New Lints
18+
19+
* [`large_futures`]
20+
[#10414](https://github.com/rust-lang/rust-clippy/pull/10414)
21+
* [`missing_assert_message`]
22+
[#10362](https://github.com/rust-lang/rust-clippy/pull/10362)
23+
* [`clear_with_drain`]
24+
[#10528](https://github.com/rust-lang/rust-clippy/pull/10528)
25+
* [`redundant_async_block`]
26+
[#10448](https://github.com/rust-lang/rust-clippy/pull/10448)
27+
* [`collection_is_never_read`]
28+
[#10415](https://github.com/rust-lang/rust-clippy/pull/10415)
29+
* [`let_with_type_underscore`]
30+
[#10467](https://github.com/rust-lang/rust-clippy/pull/10467)
31+
* [`tests_outside_test_module`]
32+
[#10543](https://github.com/rust-lang/rust-clippy/pull/10543)
33+
* [`allow_attributes`]
34+
[#10481](https://github.com/rust-lang/rust-clippy/pull/10481)
35+
* [`suspicious_doc_comments`]
36+
[#10497](https://github.com/rust-lang/rust-clippy/pull/10497)
37+
* [`unnecessary_box_returns`]
38+
[#9102](https://github.com/rust-lang/rust-clippy/pull/9102)
39+
* [`manual_main_separator_str`]
40+
[#10483](https://github.com/rust-lang/rust-clippy/pull/10483)
41+
* [`unnecessary_struct_initialization`]
42+
[#10489](https://github.com/rust-lang/rust-clippy/pull/10489)
43+
* [`manual_slice_size_calculation`]
44+
[#10601](https://github.com/rust-lang/rust-clippy/pull/10601)
45+
* [`lines_filter_map_ok`]
46+
[#10534](https://github.com/rust-lang/rust-clippy/pull/10534)
47+
48+
### Moves and Deprecations
49+
50+
* Moved [`let_underscore_untyped`] to `restriction`
51+
[#10442](https://github.com/rust-lang/rust-clippy/pull/10442)
52+
53+
### Enhancements
54+
55+
* [`extra_unused_type_parameters`]: No longer lints on public items if `avoid-breaking-exported-api` is set
56+
[#10536](https://github.com/rust-lang/rust-clippy/pull/10536)
57+
* [`len_without_is_empty`]: Now also detects `async` functions
58+
[#10359](https://github.com/rust-lang/rust-clippy/pull/10359)
59+
* [`arithmetic_side_effects`]: Now correctly handles divisions and modulo expressions if the right-hand-side
60+
is unknown
61+
[#10585](https://github.com/rust-lang/rust-clippy/pull/10585)
62+
* [`nonminimal_bool`]: No longer ignores `#[allow]` attributes
63+
[#10588](https://github.com/rust-lang/rust-clippy/pull/10588)
64+
* [`uninit_vec`], [`uninit_assumed_init`]: Now uses a better heuristic
65+
[#10520](https://github.com/rust-lang/rust-clippy/pull/10520)
66+
* [`ifs_same_cond`]: Now also detects immutable method calls.
67+
[#10350](https://github.com/rust-lang/rust-clippy/pull/10350)
68+
* [`arithmetic_side_effects`]: No longer lints on right or left shifts with constant integers, as the
69+
compiler warns about them
70+
[#10309](https://github.com/rust-lang/rust-clippy/pull/10309)
71+
* [`items_after_statements`]: `#[allow(items_after_statements)]` now works on items
72+
[#10542](https://github.com/rust-lang/rust-clippy/pull/10542)
73+
* [`significant_drop_tightening`]: Was optimized
74+
[#10533](https://github.com/rust-lang/rust-clippy/pull/10533)
75+
76+
### False Positive Fixes
77+
78+
* [`single_component_path_imports`]: No longer lints if the import is used relative to `self`
79+
[#10566](https://github.com/rust-lang/rust-clippy/pull/10566)
80+
* [`derivable_impls`]: No longer suggests deriving `Default` on generics with implicit arguments
81+
[#10399](https://github.com/rust-lang/rust-clippy/pull/10399)
82+
* [`let_unit_value`]: No longer lints if the expression contains an `await`
83+
[#10439](https://github.com/rust-lang/rust-clippy/pull/10439)
84+
* [`double_must_use`]: Now ignores `async` functions
85+
[#10589](https://github.com/rust-lang/rust-clippy/pull/10589)
86+
* [`manual_clamp`]: No longer lints in constant context
87+
[#10479](https://github.com/rust-lang/rust-clippy/pull/10479)
88+
* [`almost_swapped`]: Now ignores external macros
89+
[#10502](https://github.com/rust-lang/rust-clippy/pull/10502)
90+
* [`nonminimal_bool`]: Now ignores macros
91+
[#10527](https://github.com/rust-lang/rust-clippy/pull/10527)
92+
* [`needless_return`]: No longer lints match statements with incompatible branches
93+
[#10593](https://github.com/rust-lang/rust-clippy/pull/10593)
94+
* [`use_self`]: Do not suggest using `Self` in const generic parameters
95+
[#10375](https://github.com/rust-lang/rust-clippy/pull/10375)
96+
* [`mem_replace_option_with_none`]: No longer lints on field expressions
97+
[#10594](https://github.com/rust-lang/rust-clippy/pull/10594)
98+
* [`items_after_statements`]: No longer lints on times from macros
99+
[#10542](https://github.com/rust-lang/rust-clippy/pull/10542)
100+
* [`print_literal`], [`write_literal`]: No longer lint strings coming from the `file!()` macro
101+
[#10573](https://github.com/rust-lang/rust-clippy/pull/10573)
102+
* [`uninit_vec`], [`uninit_assumed_init`]: Now check the types inside arrays and tuples
103+
[#10553](https://github.com/rust-lang/rust-clippy/pull/10553)
104+
* [`almost_swapped`]: No longer lints if a variable is assigned to itself
105+
[#10499](https://github.com/rust-lang/rust-clippy/pull/10499)
106+
* [`missing_docs_in_private_items`]: No longer lints on public items
107+
[#10324](https://github.com/rust-lang/rust-clippy/pull/10324)
108+
109+
### Suggestion Fixes/Improvements
110+
111+
* [`extra_unused_type_parameters`]: The suggestion is now machine applicable
112+
[#10536](https://github.com/rust-lang/rust-clippy/pull/10536)
113+
* [`match_single_binding`]: Now adds a semicolon after the suggestion
114+
[#10470](https://github.com/rust-lang/rust-clippy/pull/10470)
115+
* [`missing_const_for_fn`]: Now includes a note if the change could break compatibility
116+
[#10618](https://github.com/rust-lang/rust-clippy/pull/10618)
117+
* [`cast_possible_truncation`]: Corrected suggestion for float and wildcard casts
118+
[#10496](https://github.com/rust-lang/rust-clippy/pull/10496)
119+
* [`transmutes_expressible_as_ptr_casts`]: The suggestion now includes parentheses when they are required
120+
[#10454](https://github.com/rust-lang/rust-clippy/pull/10454)
121+
122+
### ICE Fixes
123+
124+
* [`needless_borrow`]: No longer panics on ambiguous projections
125+
[#10403](https://github.com/rust-lang/rust-clippy/pull/10403)
126+
* [`multiple_unsafe_ops_per_block`]: Fix ICE when calling a function-like object in an unsafe block
127+
[#10405](https://github.com/rust-lang/rust-clippy/pull/10405)
128+
129+
### Others
130+
131+
* `clippy-driver` now searches parent directories for `clippy.toml` files
132+
[#10592](https://github.com/rust-lang/rust-clippy/pull/10592)
133+
* Fixed a deserialization error for the `array-size-threshold` config value
134+
[#10423](https://github.com/rust-lang/rust-clippy/pull/10423)
10135

11136
## Rust 1.69
12137

@@ -4838,6 +4963,7 @@ Released 2018-09-13
48384963
[`missing_docs_in_private_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
48394964
[`missing_enforced_import_renames`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_enforced_import_renames
48404965
[`missing_errors_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
4966+
[`missing_fields_in_debug`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_fields_in_debug
48414967
[`missing_inline_in_public_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
48424968
[`missing_panics_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
48434969
[`missing_safety_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
@@ -4874,6 +5000,7 @@ Released 2018-09-13
48745000
[`needless_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect
48755001
[`needless_continue`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_continue
48765002
[`needless_doctest_main`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
5003+
[`needless_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_else
48775004
[`needless_for_each`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_for_each
48785005
[`needless_late_init`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
48795006
[`needless_lifetimes`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
@@ -4949,6 +5076,7 @@ Released 2018-09-13
49495076
[`println_empty_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string
49505077
[`ptr_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
49515078
[`ptr_as_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
5079+
[`ptr_cast_constness`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness
49525080
[`ptr_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq
49535081
[`ptr_offset_with_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
49545082
[`pub_enum_variant_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#pub_enum_variant_names

Diff for: src/tools/clippy/Cargo.toml

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.71"
3+
version = "0.1.72"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"
@@ -30,16 +30,11 @@ termize = "0.1"
3030
compiletest_rs = { version = "0.10", features = ["tmp"] }
3131
tester = "0.9"
3232
regex = "1.5"
33-
toml = "0.5"
33+
toml = "0.7.3"
3434
walkdir = "2.3"
3535
# This is used by the `collect-metadata` alias.
3636
filetime = "0.2"
3737

38-
# A noop dependency that changes in the Rust repository, it's a bit of a hack.
39-
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
40-
# for more information.
41-
rustc-workspace-hack = "1.0"
42-
4338
# UI test dependencies
4439
clap = { version = "4.1.4", features = ["derive"] }
4540
clippy_utils = { path = "clippy_utils" }

0 commit comments

Comments
 (0)