Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
cef9cb8
fix(needless_maybe_sized): don't lint in proc-macro-generated code
ada4a Sep 7, 2025
72ff51a
Add new `disallowed_fields` lint
GuillaumeGomez Dec 11, 2025
50526ba
Add new `PathNS::Field` variant
GuillaumeGomez Dec 30, 2025
fcccbf1
The path from a type to itself is `Self`
samueltardieu Jan 8, 2026
759c2bf
Assume that any external function might return a type alias
samueltardieu Jan 16, 2026
b05aec3
Fix panic/assert message detection in edition 2015/2018
Alexendoo Jan 27, 2026
d0c6a64
Fix `redundant_iter_cloned` false positive with move closures and cor…
lapla-cogito Feb 1, 2026
91de07d
Extend `iter_kv_map` to cover `flat_map` and `filter_map`
profetia Feb 5, 2026
0df2894
Apply `iter_kv_map` to Clippy itself
profetia Feb 5, 2026
2753bf0
Extend `manual_is_variant_and` to cover `filter` chaining `is_some`
profetia Feb 5, 2026
8a31b2f
Apply `manual_is_variant_and` to Clippy itself
profetia Feb 5, 2026
5db9e1c
Add MSRV-based tests to `duration_suboptimal_units` lint
samueltardieu Feb 6, 2026
559f1c3
Replace a stale clippy `CURRENT_RUSTC_VERSION`
cuviper Feb 6, 2026
12109e4
Create new `clippy_utils::ty::get_field_def_id_by_name` function
GuillaumeGomez Jan 7, 2026
cb68b21
Extend `disallowed_fields` lint on variant fields
GuillaumeGomez Feb 9, 2026
99e4722
Stabilize assert_matches
Voultapher Jan 23, 2026
ae2d679
Fix clippy ast utils
mu001999 Jan 28, 2026
f9b1c91
allow `deprecated(since = "CURRENT_RUSTC_VERSION")`
cyrgani Feb 12, 2026
c8fd55b
Merge commit 'a62c6af53676bb15a40488ce2d632de558f001de' into clippy-s…
flip1995 Feb 12, 2026
0f4f81d
Make `iter_kv_map` to cover `flat_map` and `filter_map` (#16519)
dswij Feb 13, 2026
2655d8d
`clippy_dev`: Stores parsed lints in a map indexed by name.
Jarcho Oct 16, 2025
2658ce8
`clippy_dev`: Use types to differentiate rustc and clippy lints.
Jarcho Oct 20, 2025
43eb3b9
fix: `RustcCallbacks::config()` in `clippy-driver`
devjgm Feb 13, 2026
2737b26
Fix the compile-test tests when setting Cargo's `build.build-dir` set…
jakubadamw Feb 14, 2026
6c04e46
Port #[rustc_test_marker] to the attribute parser
Ozzy1423 Feb 13, 2026
ad7979b
Assume that any external function might return a type alias (#16415)
dswij Feb 14, 2026
18a4108
Fix the compile-test tests when setting Cargo's `build.build-dir` set…
samueltardieu Feb 14, 2026
904a750
Extend `collapsible_match` to cover `if-else`s
profetia Feb 13, 2026
5be3049
Apply `collapsible_match` to Clippy itself
profetia Feb 13, 2026
ec1e165
Provide all lint group names to Clippy
Alexendoo Feb 14, 2026
845936f
Rollup merge of #152188 - cuviper:placeholder-stdarch, r=Mark-Simulacrum
jhpratt Feb 15, 2026
9d850a0
Rollup merge of #152625 - Alexendoo:lint-group-names, r=Kivooeo
JonathanBrouwer Feb 15, 2026
87c404e
fix: `RustcCallbacks::config()` in `clippy-driver` (#16562)
Alexendoo Feb 16, 2026
32d32b6
adjust clippy to fix some of the issues
RalfJung Nov 9, 2025
d5643a0
Rollup merge of #151783 - mu001999-contrib:impl/final-method, r=fee1-…
Zalathar Feb 17, 2026
1750703
Remove ShallowInitBox.
cjgillot Oct 15, 2025
bd21958
Remove `env` macro use from ui tests.
Jarcho Feb 17, 2026
24cccf9
Fix `redundant_iter_cloned` false positive with move closures and cor…
Jarcho Feb 17, 2026
e299e18
Remove `env` macro use from ui tests. (#16580)
samueltardieu Feb 17, 2026
b8e86e6
Unify wording of resolve error
estebank Aug 12, 2025
f72e055
Add unnecessary_trailing_comma lint
nyurik Feb 6, 2026
1994230
fix(str_to_string): false positive non-str types
nyurik Feb 15, 2026
899fa02
Rollup merge of #152758 - cjgillot:noinit-box, r=RalfJung
Zalathar Feb 18, 2026
b0c4cba
Fix stale metadata output comment in compile-test
szokeasaurusrex Feb 18, 2026
52a32d6
Fix stale metadata output comment in compile-test (#16583)
llogiq Feb 18, 2026
a25baf6
fix(str_to_string): false positive non-str types (#16571)
samueltardieu Feb 19, 2026
4916d95
Fix unnecessary_min_or_max for usize
Taym95 Feb 19, 2026
3b2b250
DRY: make all `span_lint_*` use `span_lint{_hir,}_and_then`
samueltardieu Feb 19, 2026
e96a83b
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Feb 19, 2026
650809e
Bump nightly version -> 2026-02-19
flip1995 Feb 19, 2026
e63814d
Rustup (#16588)
flip1995 Feb 19, 2026
e3d2a31
`result-map-unit-fn`: use "a" before `Result`
DanielEScherzer Feb 19, 2026
d65fe0b
`useless_conversion`: also fire inside compiler desugarings
lapla-cogito Feb 20, 2026
d197fc8
`result-map-unit-fn`: use "a" before `Result` (#16593)
samueltardieu Feb 20, 2026
7064751
Add new `disallowed_fields` lint (#16218)
Jarcho Feb 20, 2026
18e5b2d
Fix unnecessary_min_or_max for usize (#16575)
dswij Feb 20, 2026
5991fd9
Add brackets around unsafe or labeled block used in `else`
samueltardieu Feb 21, 2026
92fb0f7
make unnecessary_fold commutative
mikhailofff Feb 21, 2026
5137bb3
Handle `Result<T, !>` and `ControlFlow<!, T>` as `T` wrt `#[must_use]`
samueltardieu Jan 7, 2026
b84fc43
allow unwrap types
sengmonkham Feb 21, 2026
2acc3e3
Add brackets around unsafe or labeled block used in `else` (#16603)
llogiq Feb 21, 2026
349e809
Handle `Result<T, !>` and `ControlFlow<!, T>` as `T` wrt `#[must_use]…
Jarcho Feb 21, 2026
9de20be
Make `unnecessary_fold` commutative (#16604)
llogiq Feb 21, 2026
ef1ee71
Enhance `unchecked_time_subtraction` to better handle `Duration` lite…
profetia Feb 6, 2026
296fe3a
Make `unchecked_time_subtraction` to better handle `Duration` literal…
samueltardieu Feb 21, 2026
2f6e9e4
Add `Sugg::strip_paren()`
samueltardieu Feb 21, 2026
b0a25d2
feat(clone_on_ref_ptr): don't add a `&` to the receiver if it's a ref…
ada4a Sep 23, 2025
8193734
Add `allow-unwrap-types` configuration for `unwrap_used` and `expect_…
llogiq Feb 21, 2026
94337ce
DRY: make all `span_lint_*` use `span_lint{_hir,}_and_then` (#16587)
llogiq Feb 21, 2026
d074e48
feat(clone_on_ref_ptr): don't add a `&` to the receiver if it's a ref…
samueltardieu Feb 21, 2026
394afbe
Remove `no-rustfix` marker for tests with no lint suggestions
samueltardieu Feb 22, 2026
b12ef56
Remove `no-rustfix` marker for tests with valid suggestions
samueltardieu Feb 22, 2026
b3188b8
Remove `no-rustfix` marker for tests with no lint suggestions (#16608)
llogiq Feb 22, 2026
a95d0c5
book: describe Clippy walk up directory tree behavior when searching …
AlexTMjugador Feb 22, 2026
dcb8800
`useless_conversion`: also fire inside compiler desugarings (#16594)
llogiq Feb 22, 2026
ad08bd6
Enhance `collapsible_match` to cover if-elses (#16560)
llogiq Feb 22, 2026
b36f285
allow `deprecated(since = "CURRENT_RUSTC_VERSION")` (#16557)
llogiq Feb 22, 2026
a57ca61
`clippy_dev`: Parsing revamp part 4/N (#15978)
llogiq Feb 22, 2026
6211fa9
The path from a type to itself is `Self` (#16362)
llogiq Feb 22, 2026
9a1cabf
Fix panic/assert message detection in edition 2015/2018 (#16473)
llogiq Feb 22, 2026
739f462
Enhance `manual_is_variant_and` to cover `filter` chaining `is_some` …
llogiq Feb 22, 2026
ea45686
Add MSRV-based tests to `duration_suboptimal_units` lint (#16526)
llogiq Feb 22, 2026
34d0b12
correct `join_absolute_paths` for a double backslash
mikhailofff Feb 22, 2026
f2a134b
remove `no-rustfix` marker for tests
mikhailofff Feb 22, 2026
0492671
Fix `join_absolute_paths` to work correctly depending on the platform…
samueltardieu Feb 22, 2026
f271387
Remove `no-rustfix` marker for tests with valid suggestions (#16609)
Jarcho Feb 23, 2026
38321c8
Add unnecessary_trailing_comma lint (#16530)
Jarcho Feb 23, 2026
0776e01
fix(needless_maybe_sized): don't lint in proc-macro-generated code (#…
Jarcho Feb 23, 2026
6fe95cb
changelog_update.md: update name of rust primary branch
DanielEScherzer Feb 23, 2026
2df0b08
changelog_update.md: update name of rust primary branch (#16621)
flip1995 Feb 23, 2026
714841f
book: describe Clippy walk up directory tree behavior when searching …
flip1995 Feb 23, 2026
f56dfe4
test: don't call test functions in `main`
ada4a Feb 19, 2026
12abbc0
Do not suggest removing reborrow of a captured upvar
samueltardieu Feb 23, 2026
afece5d
Do not suggest removing reborrow of a captured upvar (#16622)
Jarcho Feb 23, 2026
26e5edc
test: don't call test functions in `main` (#16589)
Jarcho Feb 23, 2026
c234b12
fix: `explicit_counter_loop` FN when loop counter starts at non-zero
profetia Feb 23, 2026
5e242b6
Revert "Fix the compile-test tests when setting Cargo's `build.build-…
samueltardieu Feb 23, 2026
b2a5ee9
Revert "Fix the compile-test tests when setting Cargo's `build.build-…
samueltardieu Feb 23, 2026
df995ed
Fix `explicit_counter_loop` FN when loop counter starts at non-zero (…
Jarcho Feb 23, 2026
1bbdc1a
Merge commit 'df995ede1b3e61f0e87081d9548e6cd2a3ec9095' into clippy-s…
flip1995 Feb 24, 2026
f597b0f
allow clippy::collapsible_match in cg_gcc
flip1995 Feb 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/rustc_codegen_gcc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![warn(unused_lifetimes)]
#![deny(clippy::pattern_type_mismatch)]
#![expect(clippy::uninlined_format_args)]
#![allow(clippy::collapsible_match)]

// The rustc crates we need
extern crate rustc_abi;
Expand Down
9 changes: 9 additions & 0 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ document.

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

### New Lints

* Added [`unnecessary_trailing_comma`] to `style` (single-line format-like macros only)
[#13965](https://github.com/rust-lang/rust-clippy/issues/13965)

## Rust 1.93

Current stable, released 2026-01-22
Expand Down Expand Up @@ -6433,6 +6438,7 @@ Released 2018-09-13
[`derive_ord_xor_partial_ord`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_ord_xor_partial_ord
[`derive_partial_eq_without_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
[`derived_hash_with_manual_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derived_hash_with_manual_eq
[`disallowed_fields`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_fields
[`disallowed_macros`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros
[`disallowed_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_method
[`disallowed_methods`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
Expand Down Expand Up @@ -7136,6 +7142,7 @@ Released 2018-09-13
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
[`unnecessary_struct_initialization`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_struct_initialization
[`unnecessary_to_owned`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
[`unnecessary_trailing_comma`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_trailing_comma
[`unnecessary_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
[`unnecessary_wraps`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
[`unneeded_field_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern
Expand Down Expand Up @@ -7233,6 +7240,7 @@ Released 2018-09-13
[`allow-renamed-params-for`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-renamed-params-for
[`allow-unwrap-in-consts`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-in-consts
[`allow-unwrap-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-in-tests
[`allow-unwrap-types`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-types
[`allow-useless-vec-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-useless-vec-in-tests
[`allowed-dotfiles`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-dotfiles
[`allowed-duplicate-crates`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-duplicate-crates
Expand All @@ -7252,6 +7260,7 @@ Released 2018-09-13
[`check-private-items`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-private-items
[`cognitive-complexity-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#cognitive-complexity-threshold
[`const-literal-digits-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#const-literal-digits-threshold
[`disallowed-fields`]: https://doc.rust-lang.org/clippy/lint_configuration.html#disallowed-fields
[`disallowed-macros`]: https://doc.rust-lang.org/clippy/lint_configuration.html#disallowed-macros
[`disallowed-methods`]: https://doc.rust-lang.org/clippy/lint_configuration.html#disallowed-methods
[`disallowed-names`]: https://doc.rust-lang.org/clippy/lint_configuration.html#disallowed-names
Expand Down
6 changes: 5 additions & 1 deletion src/tools/clippy/book/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

> **Note:** The configuration file is unstable and may be deprecated in the future.

Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`, which is searched for in:
Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`, which is searched for starting in the
first defined directory according to the following priority order:

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

If the chosen directory does not contain a configuration file, Clippy will walk up the directory tree, searching each
parent directory until it finds one or reaches the filesystem root.

It contains a basic `variable = value` mapping e.g.

```toml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ bullet points might be helpful:
check out the Clippy commit of the current Rust `beta` branch.
[Link][rust_beta_tools]
* When writing the release notes for the **upcoming beta release**, you need to
check out the Clippy commit of the current Rust `master`.
[Link][rust_master_tools]
check out the Clippy commit of the current Rust `main`.
[Link][rust_main_tools]
* When writing the (forgotten) release notes for a **past stable release**, you
need to check out the Rust release tag of the stable release.
[Link][rust_stable_tools]
Expand Down Expand Up @@ -112,7 +112,7 @@ written for. If not, update the version to the changelog version.

[changelog]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md
[forge]: https://forge.rust-lang.org/
[rust_master_tools]: https://github.com/rust-lang/rust/tree/HEAD/src/tools/clippy
[rust_main_tools]: https://github.com/rust-lang/rust/tree/HEAD/src/tools/clippy
[rust_beta_tools]: https://github.com/rust-lang/rust/tree/beta/src/tools/clippy
[rust_stable_tools]: https://github.com/rust-lang/rust/releases
[`beta-accepted`]: https://github.com/rust-lang/rust-clippy/issues?q=label%3Abeta-accepted+
Expand Down
34 changes: 34 additions & 0 deletions src/tools/clippy/book/src/lint_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,23 @@ Whether `unwrap` should be allowed in test functions or `#[cfg(test)]`
* [`unwrap_used`](https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used)


## `allow-unwrap-types`
List of types to allow `unwrap()` and `expect()` on.

#### Example

```toml
allow-unwrap-types = [ "std::sync::LockResult" ]
```

**Default Value:** `[]`

---
**Affected lints:**
* [`expect_used`](https://rust-lang.github.io/rust-clippy/master/index.html#expect_used)
* [`unwrap_used`](https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used)


## `allow-useless-vec-in-tests`
Whether `useless_vec` should ignore test functions or `#[cfg(test)]`

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


## `disallowed-fields`
The list of disallowed fields, written as fully qualified paths.

**Fields:**
- `path` (required): the fully qualified path to the field that should be disallowed
- `reason` (optional): explanation why this field is disallowed
- `replacement` (optional): suggested alternative method
- `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
if the path doesn't exist, instead of emitting an error

**Default Value:** `[]`

---
**Affected lints:**
* [`disallowed_fields`](https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_fields)


## `disallowed-macros`
The list of disallowed macros, written as fully qualified paths.

Expand Down
20 changes: 20 additions & 0 deletions src/tools/clippy/clippy_config/src/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,15 @@ define_Conf! {
/// Whether `unwrap` should be allowed in test functions or `#[cfg(test)]`
#[lints(unwrap_used)]
allow_unwrap_in_tests: bool = false,
/// List of types to allow `unwrap()` and `expect()` on.
///
/// #### Example
///
/// ```toml
/// allow-unwrap-types = [ "std::sync::LockResult" ]
/// ```
#[lints(expect_used, unwrap_used)]
allow_unwrap_types: Vec<String> = Vec::new(),
/// Whether `useless_vec` should ignore test functions or `#[cfg(test)]`
#[lints(useless_vec)]
allow_useless_vec_in_tests: bool = false,
Expand Down Expand Up @@ -581,6 +590,17 @@ define_Conf! {
/// Use the Cognitive Complexity lint instead.
#[conf_deprecated("Please use `cognitive-complexity-threshold` instead", cognitive_complexity_threshold)]
cyclomatic_complexity_threshold: u64 = 25,
/// The list of disallowed fields, written as fully qualified paths.
///
/// **Fields:**
/// - `path` (required): the fully qualified path to the field that should be disallowed
/// - `reason` (optional): explanation why this field is disallowed
/// - `replacement` (optional): suggested alternative method
/// - `allow-invalid` (optional, `false` by default): when set to `true`, it will ignore this entry
/// if the path doesn't exist, instead of emitting an error
#[disallowed_paths_allow_replacements = true]
#[lints(disallowed_fields)]
disallowed_fields: Vec<DisallowedPath> = Vec::new(),
/// The list of disallowed macros, written as fully qualified paths.
///
/// **Fields:**
Expand Down
Loading
Loading