Skip to content

Commit 351686b

Browse files
committed
Auto merge of #137752 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update ? `@Manishearth` Cargo.lock change because of Clippy version bump and rustc_tool_utils new release. Fixes #137640 Would be nice, if we could this merged before nightly is being build, so that this ICE is fixed tomorrow.
2 parents 8c39296 + 7bfea66 commit 351686b

File tree

2,649 files changed

+34676
-15397
lines changed

Some content is hidden

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

2,649 files changed

+34676
-15397
lines changed

Cargo.lock

+10-6
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ dependencies = [
358358
"cargo_metadata 0.18.1",
359359
"directories",
360360
"rustc-build-sysroot",
361-
"rustc_tools_util",
361+
"rustc_tools_util 0.4.0",
362362
"rustc_version",
363363
"serde",
364364
"serde_json",
@@ -522,7 +522,7 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
522522

523523
[[package]]
524524
name = "clippy"
525-
version = "0.1.86"
525+
version = "0.1.87"
526526
dependencies = [
527527
"anstream",
528528
"cargo_metadata 0.18.1",
@@ -539,7 +539,7 @@ dependencies = [
539539
"quote",
540540
"regex",
541541
"rinja",
542-
"rustc_tools_util",
542+
"rustc_tools_util 0.4.2",
543543
"serde",
544544
"serde_json",
545545
"syn 2.0.96",
@@ -553,7 +553,7 @@ dependencies = [
553553

554554
[[package]]
555555
name = "clippy_config"
556-
version = "0.1.86"
556+
version = "0.1.87"
557557
dependencies = [
558558
"clippy_utils",
559559
"itertools",
@@ -578,7 +578,7 @@ dependencies = [
578578

579579
[[package]]
580580
name = "clippy_lints"
581-
version = "0.1.86"
581+
version = "0.1.87"
582582
dependencies = [
583583
"arrayvec",
584584
"cargo_metadata 0.18.1",
@@ -601,7 +601,7 @@ dependencies = [
601601

602602
[[package]]
603603
name = "clippy_utils"
604-
version = "0.1.86"
604+
version = "0.1.87"
605605
dependencies = [
606606
"arrayvec",
607607
"itertools",
@@ -4454,6 +4454,10 @@ version = "0.4.0"
44544454
source = "registry+https://github.com/rust-lang/crates.io-index"
44554455
checksum = "3316159ab19e19d1065ecc49278e87f767a9dae9fae80348d2b4d4fa4ae02d4d"
44564456

4457+
[[package]]
4458+
name = "rustc_tools_util"
4459+
version = "0.4.2"
4460+
44574461
[[package]]
44584462
name = "rustc_trait_selection"
44594463
version = "0.0.0"

src/tools/clippy/CHANGELOG.md

+57-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,53 @@ document.
66

77
## Unreleased / Beta / In Rust Nightly
88

9-
[786fbd6d...master](https://github.com/rust-lang/rust-clippy/compare/786fbd6d...master)
9+
[609cd310...master](https://github.com/rust-lang/rust-clippy/compare/609cd310...master)
10+
11+
## Rust 1.85
12+
13+
Current stable, released 2025-02-20
14+
15+
[View all 72 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-11-15T19%3A31%3A08Z..2024-12-26T13%3A59%3A48Z+base%3Amaster)
16+
17+
### New Lints
18+
19+
* Added [`repr_packed_without_abi`] to `suspicious`
20+
[#13398](https://github.com/rust-lang/rust-clippy/pull/13398)
21+
* Added [`as_pointer_underscore`] to `restriction`
22+
[#13251](https://github.com/rust-lang/rust-clippy/pull/13251)
23+
* Added [`doc_nested_refdefs`] to `suspicious`
24+
[#13707](https://github.com/rust-lang/rust-clippy/pull/13707)
25+
* Added [`literal_string_with_formatting_args`] to `nursery`
26+
[#13410](https://github.com/rust-lang/rust-clippy/pull/13410)
27+
* Added [`doc_include_without_cfg`] to `restriction`
28+
[#13625](https://github.com/rust-lang/rust-clippy/pull/13625)
29+
30+
### Enhancements
31+
32+
* [`indexing_slicing`]: Can now be allowed in tests using the [`allow-indexing-slicing-in-tests`]
33+
configuration
34+
[#13854](https://github.com/rust-lang/rust-clippy/pull/13854)
35+
* [`if_let_mutex`]: disable lint from Edition 2024 since
36+
[if_let_rescope](https://github.com/rust-lang/rust/issues/131154) was stabilized
37+
[#13695](https://github.com/rust-lang/rust-clippy/pull/13695)
38+
* [`format_in_format_args`], [`recursive_format_impl`], [`to_string_in_format_args`],
39+
[`uninlined_format_args`], [`unused_format_specs`]: Can now support 3rd party format macros
40+
if they're marked with the `#[clippy::format_args]` attribute
41+
[#9948](https://github.com/rust-lang/rust-clippy/pull/9948)
42+
43+
### ICE Fixes
44+
45+
* [`trait_duplication_in_bounds`]: fix ICE on duplicate type or constant bound
46+
[#13722](https://github.com/rust-lang/rust-clippy/pull/13722)
47+
48+
### Others
49+
50+
* `clippy_utils` is now published to crates.io. Note that this crate is and will remain unstable.
51+
[#13700](https://github.com/rust-lang/rust-clippy/pull/13700)
1052

1153
## Rust 1.84
1254

13-
Current stable, released 2025-01-09
55+
Released 2025-01-09
1456

1557
[View all 84 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-10-03T21%3A23%3A58Z..2024-11-14T17%3A41%3A37Z+base%3Amaster)
1658

@@ -5530,6 +5572,7 @@ Released 2018-09-13
55305572
[`diverging_sub_expression`]: https://rust-lang.github.io/rust-clippy/master/index.html#diverging_sub_expression
55315573
[`doc_include_without_cfg`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_include_without_cfg
55325574
[`doc_lazy_continuation`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
5575+
[`doc_link_code`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_code
55335576
[`doc_link_with_quotes`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes
55345577
[`doc_markdown`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
55355578
[`doc_nested_refdefs`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_nested_refdefs
@@ -5549,6 +5592,7 @@ Released 2018-09-13
55495592
[`duplicated_attributes`]: https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
55505593
[`duration_subsec`]: https://rust-lang.github.io/rust-clippy/master/index.html#duration_subsec
55515594
[`eager_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#eager_transmute
5595+
[`elidable_lifetime_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
55525596
[`else_if_without_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#else_if_without_else
55535597
[`empty_docs`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
55545598
[`empty_drop`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_drop
@@ -5683,6 +5727,7 @@ Released 2018-09-13
56835727
[`invalid_utf8_in_unchecked`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_utf8_in_unchecked
56845728
[`inverted_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#inverted_saturating_sub
56855729
[`invisible_characters`]: https://rust-lang.github.io/rust-clippy/master/index.html#invisible_characters
5730+
[`io_other_error`]: https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error
56865731
[`is_digit_ascii_radix`]: https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix
56875732
[`items_after_statements`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
56885733
[`items_after_test_module`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module
@@ -5742,6 +5787,7 @@ Released 2018-09-13
57425787
[`manual_bits`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits
57435788
[`manual_c_str_literals`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_c_str_literals
57445789
[`manual_clamp`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
5790+
[`manual_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains
57455791
[`manual_div_ceil`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
57465792
[`manual_filter`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter
57475793
[`manual_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter_map
@@ -5761,6 +5807,7 @@ Released 2018-09-13
57615807
[`manual_main_separator_str`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_main_separator_str
57625808
[`manual_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
57635809
[`manual_memcpy`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy
5810+
[`manual_midpoint`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_midpoint
57645811
[`manual_next_back`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_next_back
57655812
[`manual_non_exhaustive`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
57665813
[`manual_ok_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err
@@ -5812,6 +5859,7 @@ Released 2018-09-13
58125859
[`mem_discriminant_non_enum`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_discriminant_non_enum
58135860
[`mem_forget`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_forget
58145861
[`mem_replace_option_with_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none
5862+
[`mem_replace_option_with_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_some
58155863
[`mem_replace_with_default`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default
58165864
[`mem_replace_with_uninit`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_uninit
58175865
[`min_ident_chars`]: https://rust-lang.github.io/rust-clippy/master/index.html#min_ident_chars
@@ -5939,6 +5987,7 @@ Released 2018-09-13
59395987
[`out_of_bounds_indexing`]: https://rust-lang.github.io/rust-clippy/master/index.html#out_of_bounds_indexing
59405988
[`overflow_check_conditional`]: https://rust-lang.github.io/rust-clippy/master/index.html#overflow_check_conditional
59415989
[`overly_complex_bool_expr`]: https://rust-lang.github.io/rust-clippy/master/index.html#overly_complex_bool_expr
5990+
[`owned_cow`]: https://rust-lang.github.io/rust-clippy/master/index.html#owned_cow
59425991
[`panic`]: https://rust-lang.github.io/rust-clippy/master/index.html#panic
59435992
[`panic_in_result_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#panic_in_result_fn
59445993
[`panic_params`]: https://rust-lang.github.io/rust-clippy/master/index.html#panic_params
@@ -6067,6 +6116,7 @@ Released 2018-09-13
60676116
[`single_element_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_element_loop
60686117
[`single_match`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_match
60696118
[`single_match_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else
6119+
[`single_option_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_option_map
60706120
[`single_range_in_vec_init`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init
60716121
[`size_of_in_element_count`]: https://rust-lang.github.io/rust-clippy/master/index.html#size_of_in_element_count
60726122
[`size_of_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#size_of_ref
@@ -6143,6 +6193,7 @@ Released 2018-09-13
61436193
[`type_complexity`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
61446194
[`type_id_on_box`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_id_on_box
61456195
[`type_repetition_in_bounds`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
6196+
[`unbuffered_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#unbuffered_bytes
61466197
[`unchecked_duration_subtraction`]: https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_duration_subtraction
61476198
[`unconditional_recursion`]: https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion
61486199
[`undocumented_unsafe_blocks`]: https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
@@ -6161,6 +6212,7 @@ Released 2018-09-13
61616212
[`unnecessary_box_returns`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_box_returns
61626213
[`unnecessary_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
61636214
[`unnecessary_clippy_cfg`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_clippy_cfg
6215+
[`unnecessary_debug_formatting`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_debug_formatting
61646216
[`unnecessary_fallible_conversions`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
61656217
[`unnecessary_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map
61666218
[`unnecessary_find_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_find_map
@@ -6267,6 +6319,7 @@ Released 2018-09-13
62676319
[`accept-comment-above-statement`]: https://doc.rust-lang.org/clippy/lint_configuration.html#accept-comment-above-statement
62686320
[`allow-comparison-to-zero`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-comparison-to-zero
62696321
[`allow-dbg-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-dbg-in-tests
6322+
[`allow-expect-in-consts`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-expect-in-consts
62706323
[`allow-expect-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-expect-in-tests
62716324
[`allow-indexing-slicing-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-indexing-slicing-in-tests
62726325
[`allow-mixed-uninlined-format-args`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-mixed-uninlined-format-args
@@ -6275,6 +6328,7 @@ Released 2018-09-13
62756328
[`allow-print-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-print-in-tests
62766329
[`allow-private-module-inception`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-private-module-inception
62776330
[`allow-renamed-params-for`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-renamed-params-for
6331+
[`allow-unwrap-in-consts`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-in-consts
62786332
[`allow-unwrap-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-in-tests
62796333
[`allow-useless-vec-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-useless-vec-in-tests
62806334
[`allowed-dotfiles`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-dotfiles
@@ -6290,6 +6344,7 @@ Released 2018-09-13
62906344
[`avoid-breaking-exported-api`]: https://doc.rust-lang.org/clippy/lint_configuration.html#avoid-breaking-exported-api
62916345
[`await-holding-invalid-types`]: https://doc.rust-lang.org/clippy/lint_configuration.html#await-holding-invalid-types
62926346
[`cargo-ignore-publish`]: https://doc.rust-lang.org/clippy/lint_configuration.html#cargo-ignore-publish
6347+
[`check-incompatible-msrv-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-incompatible-msrv-in-tests
62936348
[`check-private-items`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-private-items
62946349
[`cognitive-complexity-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#cognitive-complexity-threshold
62956350
[`disallowed-macros`]: https://doc.rust-lang.org/clippy/lint_configuration.html#disallowed-macros

src/tools/clippy/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy"
33
# begin autogenerated version
4-
version = "0.1.86"
4+
version = "0.1.87"
55
# end autogenerated version
66
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
77
repository = "https://github.com/rust-lang/rust-clippy"
@@ -25,7 +25,7 @@ path = "src/driver.rs"
2525
[dependencies]
2626
clippy_config = { path = "clippy_config" }
2727
clippy_lints = { path = "clippy_lints" }
28-
rustc_tools_util = "0.4.0"
28+
rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }
2929
tempfile = { version = "3.3", optional = true }
3030
termize = "0.1"
3131
color-print = "0.3.4"
@@ -54,7 +54,7 @@ parking_lot = "0.12"
5454
tokio = { version = "1", features = ["io-util"] }
5555

5656
[build-dependencies]
57-
rustc_tools_util = "0.4.0"
57+
rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }
5858

5959
[features]
6060
integration = ["tempfile"]

src/tools/clippy/book/src/development/adding_lints.md

+15-18
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ from the lint to the code of the test file and compare that to the contents of a
169169
Use `cargo bless` to automatically generate the `.fixed` file while running
170170
the tests.
171171

172-
[rustfix]: https://github.com/rust-lang/rustfix
172+
[rustfix]: https://github.com/rust-lang/cargo/tree/master/crates/rustfix
173173

174174
## Testing manually
175175

@@ -460,7 +460,7 @@ pub struct ManualStrip {
460460

461461
impl ManualStrip {
462462
pub fn new(conf: &'static Conf) -> Self {
463-
Self { msrv: conf.msrv.clone() }
463+
Self { msrv: conf.msrv }
464464
}
465465
}
466466
```
@@ -469,24 +469,13 @@ The project's MSRV can then be matched against the feature MSRV in the LintPass
469469
using the `Msrv::meets` method.
470470

471471
``` rust
472-
if !self.msrv.meets(msrvs::STR_STRIP_PREFIX) {
472+
if !self.msrv.meets(cx, msrvs::STR_STRIP_PREFIX) {
473473
return;
474474
}
475475
```
476476

477-
The project's MSRV can also be specified as an attribute, which overrides
478-
the value from `clippy.toml`. This can be accounted for using the
479-
`extract_msrv_attr!(LintContext)` macro and passing
480-
`LateContext`/`EarlyContext`.
481-
482-
```rust,ignore
483-
impl<'tcx> LateLintPass<'tcx> for ManualStrip {
484-
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
485-
...
486-
}
487-
extract_msrv_attr!(LateContext);
488-
}
489-
```
477+
Early lint passes should instead use `MsrvStack` coupled with
478+
`extract_msrv_attr!()`
490479

491480
Once the `msrv` is added to the lint, a relevant test case should be added to
492481
the lint's test file, `tests/ui/manual_strip.rs` in this example. It should
@@ -512,8 +501,16 @@ in `clippy_config/src/conf.rs`:
512501

513502
```rust
514503
define_Conf! {
515-
/// Lint: LIST, OF, LINTS, <THE_NEWLY_ADDED_LINT>. The minimum rust version that the project supports
516-
(msrv: Option<String> = None),
504+
#[lints(
505+
allow_attributes,
506+
allow_attributes_without_reason,
507+
..
508+
<the newly added lint name>,
509+
..
510+
unused_trait_names,
511+
use_self,
512+
)]
513+
msrv: Msrv = Msrv::default(),
517514
...
518515
}
519516
```

src/tools/clippy/book/src/development/basics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ or if you modify a test file to add a test case.
7575
> _Note:_ This command may update more files than you intended. In that case
7676
> only commit the files you wanted to update.
7777
78-
[UI test]: https://rustc-dev-guide.rust-lang.org/tests/adding.html#guide-to-the-ui-tests
78+
[UI test]: https://rustc-dev-guide.rust-lang.org/tests/adding.html#ui-test-walkthrough
7979

8080
## `cargo dev`
8181

src/tools/clippy/book/src/development/writing_tests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ We'll talk about suggestions more in depth in a [later chapter](emitting_lints.m
203203
Use `cargo bless` to automatically generate the `.fixed` file after running
204204
the tests.
205205

206-
[`rustfix`]: https://github.com/rust-lang/rustfix
206+
[`rustfix`]: https://github.com/rust-lang/cargo/tree/master/crates/rustfix
207207
[`span_lint_and_sugg`]: https://doc.rust-lang.org/beta/nightly-rustc/clippy_utils/diagnostics/fn.span_lint_and_sugg.html
208208

209209
## Testing Manually

0 commit comments

Comments
 (0)