Skip to content

Commit 3f98535

Browse files
committed
Auto merge of #152862 - flip1995:clippy-subtree-update, r=samueltardieu
Clippy subtree update r? Manishearth
2 parents 58745ca + f597b0f commit 3f98535

297 files changed

Lines changed: 4971 additions & 1921 deletions

File tree

Some content is hidden

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

compiler/rustc_codegen_gcc/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![warn(unused_lifetimes)]
2020
#![deny(clippy::pattern_type_mismatch)]
2121
#![expect(clippy::uninlined_format_args)]
22+
#![allow(clippy::collapsible_match)]
2223

2324
// The rustc crates we need
2425
extern crate rustc_abi;

src/tools/clippy/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ document.
88

99
[92b4b68...master](https://github.com/rust-lang/rust-clippy/compare/92b4b68...master)
1010

11+
### New Lints
12+
13+
* Added [`unnecessary_trailing_comma`] to `style` (single-line format-like macros only)
14+
[#13965](https://github.com/rust-lang/rust-clippy/issues/13965)
15+
1116
## Rust 1.93
1217

1318
Current stable, released 2026-01-22
@@ -6433,6 +6438,7 @@ Released 2018-09-13
64336438
[`derive_ord_xor_partial_ord`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_ord_xor_partial_ord
64346439
[`derive_partial_eq_without_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
64356440
[`derived_hash_with_manual_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derived_hash_with_manual_eq
6441+
[`disallowed_fields`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_fields
64366442
[`disallowed_macros`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros
64376443
[`disallowed_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_method
64386444
[`disallowed_methods`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
@@ -7136,6 +7142,7 @@ Released 2018-09-13
71367142
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
71377143
[`unnecessary_struct_initialization`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_struct_initialization
71387144
[`unnecessary_to_owned`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
7145+
[`unnecessary_trailing_comma`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_trailing_comma
71397146
[`unnecessary_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
71407147
[`unnecessary_wraps`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
71417148
[`unneeded_field_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern
@@ -7233,6 +7240,7 @@ Released 2018-09-13
72337240
[`allow-renamed-params-for`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-renamed-params-for
72347241
[`allow-unwrap-in-consts`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-in-consts
72357242
[`allow-unwrap-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-in-tests
7243+
[`allow-unwrap-types`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-types
72367244
[`allow-useless-vec-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-useless-vec-in-tests
72377245
[`allowed-dotfiles`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-dotfiles
72387246
[`allowed-duplicate-crates`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-duplicate-crates
@@ -7252,6 +7260,7 @@ Released 2018-09-13
72527260
[`check-private-items`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-private-items
72537261
[`cognitive-complexity-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#cognitive-complexity-threshold
72547262
[`const-literal-digits-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#const-literal-digits-threshold
7263+
[`disallowed-fields`]: https://doc.rust-lang.org/clippy/lint_configuration.html#disallowed-fields
72557264
[`disallowed-macros`]: https://doc.rust-lang.org/clippy/lint_configuration.html#disallowed-macros
72567265
[`disallowed-methods`]: https://doc.rust-lang.org/clippy/lint_configuration.html#disallowed-methods
72577266
[`disallowed-names`]: https://doc.rust-lang.org/clippy/lint_configuration.html#disallowed-names

src/tools/clippy/book/src/configuration.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
> **Note:** The configuration file is unstable and may be deprecated in the future.
44
5-
Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`, which is searched for in:
5+
Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`, which is searched for starting in the
6+
first defined directory according to the following priority order:
67

78
1. The directory specified by the `CLIPPY_CONF_DIR` environment variable, or
89
2. The directory specified by the
910
[CARGO_MANIFEST_DIR](https://doc.rust-lang.org/cargo/reference/environment-variables.html) environment variable, or
1011
3. The current directory.
1112

13+
If the chosen directory does not contain a configuration file, Clippy will walk up the directory tree, searching each
14+
parent directory until it finds one or reaches the filesystem root.
15+
1216
It contains a basic `variable = value` mapping e.g.
1317

1418
```toml

src/tools/clippy/book/src/development/infrastructure/changelog_update.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ bullet points might be helpful:
2828
check out the Clippy commit of the current Rust `beta` branch.
2929
[Link][rust_beta_tools]
3030
* When writing the release notes for the **upcoming beta release**, you need to
31-
check out the Clippy commit of the current Rust `master`.
32-
[Link][rust_master_tools]
31+
check out the Clippy commit of the current Rust `main`.
32+
[Link][rust_main_tools]
3333
* When writing the (forgotten) release notes for a **past stable release**, you
3434
need to check out the Rust release tag of the stable release.
3535
[Link][rust_stable_tools]
@@ -112,7 +112,7 @@ written for. If not, update the version to the changelog version.
112112

113113
[changelog]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md
114114
[forge]: https://forge.rust-lang.org/
115-
[rust_master_tools]: https://github.com/rust-lang/rust/tree/HEAD/src/tools/clippy
115+
[rust_main_tools]: https://github.com/rust-lang/rust/tree/HEAD/src/tools/clippy
116116
[rust_beta_tools]: https://github.com/rust-lang/rust/tree/beta/src/tools/clippy
117117
[rust_stable_tools]: https://github.com/rust-lang/rust/releases
118118
[`beta-accepted`]: https://github.com/rust-lang/rust-clippy/issues?q=label%3Abeta-accepted+

src/tools/clippy/book/src/lint_configuration.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,23 @@ Whether `unwrap` should be allowed in test functions or `#[cfg(test)]`
214214
* [`unwrap_used`](https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used)
215215

216216

217+
## `allow-unwrap-types`
218+
List of types to allow `unwrap()` and `expect()` on.
219+
220+
#### Example
221+
222+
```toml
223+
allow-unwrap-types = [ "std::sync::LockResult" ]
224+
```
225+
226+
**Default Value:** `[]`
227+
228+
---
229+
**Affected lints:**
230+
* [`expect_used`](https://rust-lang.github.io/rust-clippy/master/index.html#expect_used)
231+
* [`unwrap_used`](https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used)
232+
233+
217234
## `allow-useless-vec-in-tests`
218235
Whether `useless_vec` should ignore test functions or `#[cfg(test)]`
219236

@@ -505,6 +522,23 @@ The minimum digits a const float literal must have to supress the `excessive_pre
505522
* [`excessive_precision`](https://rust-lang.github.io/rust-clippy/master/index.html#excessive_precision)
506523

507524

525+
## `disallowed-fields`
526+
The list of disallowed fields, written as fully qualified paths.
527+
528+
**Fields:**
529+
- `path` (required): the fully qualified path to the field that should be disallowed
530+
- `reason` (optional): explanation why this field is disallowed
531+
- `replacement` (optional): suggested alternative method
532+
- `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
533+
if the path doesn't exist, instead of emitting an error
534+
535+
**Default Value:** `[]`
536+
537+
---
538+
**Affected lints:**
539+
* [`disallowed_fields`](https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_fields)
540+
541+
508542
## `disallowed-macros`
509543
The list of disallowed macros, written as fully qualified paths.
510544

src/tools/clippy/clippy_config/src/conf.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,15 @@ define_Conf! {
413413
/// Whether `unwrap` should be allowed in test functions or `#[cfg(test)]`
414414
#[lints(unwrap_used)]
415415
allow_unwrap_in_tests: bool = false,
416+
/// List of types to allow `unwrap()` and `expect()` on.
417+
///
418+
/// #### Example
419+
///
420+
/// ```toml
421+
/// allow-unwrap-types = [ "std::sync::LockResult" ]
422+
/// ```
423+
#[lints(expect_used, unwrap_used)]
424+
allow_unwrap_types: Vec<String> = Vec::new(),
416425
/// Whether `useless_vec` should ignore test functions or `#[cfg(test)]`
417426
#[lints(useless_vec)]
418427
allow_useless_vec_in_tests: bool = false,
@@ -581,6 +590,17 @@ define_Conf! {
581590
/// Use the Cognitive Complexity lint instead.
582591
#[conf_deprecated("Please use `cognitive-complexity-threshold` instead", cognitive_complexity_threshold)]
583592
cyclomatic_complexity_threshold: u64 = 25,
593+
/// The list of disallowed fields, written as fully qualified paths.
594+
///
595+
/// **Fields:**
596+
/// - `path` (required): the fully qualified path to the field that should be disallowed
597+
/// - `reason` (optional): explanation why this field is disallowed
598+
/// - `replacement` (optional): suggested alternative method
599+
/// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
600+
/// if the path doesn't exist, instead of emitting an error
601+
#[disallowed_paths_allow_replacements = true]
602+
#[lints(disallowed_fields)]
603+
disallowed_fields: Vec<DisallowedPath> = Vec::new(),
584604
/// The list of disallowed macros, written as fully qualified paths.
585605
///
586606
/// **Fields:**

0 commit comments

Comments
 (0)