Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
6a16a8f
add new module style restriction lint that checks for use of inline mods
zihan0822 Mar 30, 2026
23d7346
Make `span_suggestions` always verbose
estebank Mar 30, 2026
c610584
Format missed clippy lint source files
teor2345 Apr 15, 2026
70fcd99
Refactor FnDecl and FnSig flags into packed structs
teor2345 Apr 8, 2026
9b5a48b
Require that a `<_ as Try>::Residual` implement `Residual`
scottmcm Mar 27, 2026
e3fa708
Improve suggestion for destructuring assignment with `?` operator in …
charlieHsiuC Apr 16, 2026
f9c23c1
Merge commit 'f6d310692116e9a527ce6d0b3526c965d9c5d7b9' into clippy-s…
flip1995 Apr 16, 2026
c367064
Do not propose to refactor when no variant constructor is used
samueltardieu Apr 16, 2026
8bc1aa3
Auto merge of #155380 - jhpratt:rollup-j1e7DVL, r=jhpratt
bors Apr 16, 2026
2e1628a
Do not propose to refactor when no variant constructor is used (#16867)
Jarcho Apr 16, 2026
8dcf8e6
apply useless_borrows_in_formatting fixes
nyurik Feb 6, 2026
5800532
apply useless_borrows_in_formatting fixes (#16872)
samueltardieu Apr 17, 2026
8b82654
Almost fully get rid of windows-sys 0.59
bjorn3 Apr 17, 2026
aaa5bd2
Add useless_borrows_in_formatting lint
nyurik Feb 6, 2026
0c14721
fix collapsible_match: skip if-guard lint when non-wildcard arms follow
Souradip121 Apr 17, 2026
2e7b2ba
add tests for collapsible_match: no lint when intermediate non-wildca…
Souradip121 Apr 17, 2026
0b1bdb3
Auto merge of #155404 - flip1995:clippy-subtree-update, r=Manishearth
bors Apr 17, 2026
c7cadb6
Update clippy_lints/src/matches/collapsible_match.rs
Souradip121 Apr 18, 2026
aa7dd18
fix `from_over_into` false positive with conflicting blanket From impl
pocopepe Apr 18, 2026
2d6808a
use unqualified Ty to fix rustc internal lint warning
pocopepe Apr 18, 2026
8f12b51
Auto merge of #155223 - teor2345:fndef-refactor, r=mati865
bors Apr 18, 2026
7fdbf62
Update AST pretty printing
CoCo-Japan-pan Apr 18, 2026
f1b1096
Update HIR pretty printing
CoCo-Japan-pan Apr 18, 2026
0c71cf8
Add useless_borrows_in_formatting lint (#16523)
samueltardieu Apr 19, 2026
10eb2e7
feat: add `format_width_ignored` lint
nyurik Feb 9, 2026
5c96dc7
Auto merge of #155444 - bjorn3:update_deps, r=jieyouxu
bors Apr 19, 2026
078e0ef
fix all errors
adwinwhite Apr 15, 2026
2bc5e16
Auto merge of #155083 - adwinwhite:introduce-unnormalized, r=lcnr
bors Apr 19, 2026
4351f2a
fix: `for_kv_map` FN when using `iter` and `iter_mut`
profetia Apr 9, 2026
31a89ea
Fix `for_kv_map` FN when using `iter` and `iter_mut` (#16830)
ada4a Apr 20, 2026
6f8aee0
feat(manual_assert_eq): new lint
ada4a Oct 28, 2025
47bdbaa
`useless_conversion`: do not lint `(a..b).into_iter()`.
kpreid Apr 19, 2026
87e4c91
Fixes a case where `collapsible_match` suggested a transformation tha…
samueltardieu Apr 20, 2026
f1f5580
fix: `cloned_ref_to_slice_refs` FN on `to_owned()`
profetia Jan 2, 2026
f058fe7
Fix `cloned_ref_to_slice_refs` FN on `to_owned()` (#16329)
ada4a Apr 20, 2026
d41c959
fix: [zst_offset] check for NonNull pointers
Gri-ffin Apr 19, 2026
a6c2c18
Extend `zst_offset` lint to detect NonNull<T> offset calculations (#1…
samueltardieu Apr 21, 2026
9875695
`useless_conversion`: do not lint `(a..b).into_iter()` (for edition m…
samueltardieu Apr 21, 2026
22a4b16
`AliasTermTy` refactor: fixup clippy
WaffleLapkin Apr 7, 2026
c282756
Simplify `Config::track_state`.
nnethercote Apr 23, 2026
1293dad
Rollup merge of #155442 - CoCo-Japan-pan:impl-restriction-reorder, r=…
GuillaumeGomez Apr 23, 2026
ecfdc97
Remove myself from rotation
samueltardieu Apr 23, 2026
dce4ae9
Remove myself from rotation (#16905)
samueltardieu Apr 23, 2026
a4f8cea
Auto merge of #155671 - nnethercote:simplify-Config-track_state, r=bj…
bors Apr 23, 2026
55b5409
Fix wrong `question_mark` suggestion when match arm body is a destruc…
llogiq Apr 24, 2026
33b28c6
feat: make `unused_format_specs` catch width issues (#16542)
llogiq Apr 24, 2026
f30bdb9
new module style lint: `inline_modules` (#16732)
ada4a Apr 24, 2026
146f9ab
Handle U+000B as whitespace in needless_ifs; add UI test with rustfmt…
Ajay-singh1 Apr 11, 2026
2875882
`inline_modules`: fix the rust version the lint was introduced in
ada4a Apr 24, 2026
84bb31a
feat(manual_assert_eq): new lint (#16025)
Alexendoo Apr 24, 2026
70cc275
Change `ItemKind::Trait` to have named fields.
mejrs Apr 24, 2026
47c1b32
fix(needless_ifs): handle vertical tab as whitespace to avoid false n…
dswij Apr 25, 2026
4225050
[ci] Update GitHub Actions to latest major release
gruenich Apr 26, 2026
5c81d3a
use non_blanket_impls_for_ty for the lookup
pocopepe Apr 26, 2026
f5d1ca6
`inline_modules`: fix the rust version the lint was introduced in (#1…
ada4a Apr 26, 2026
57fdfaa
fix `from_over_into` false positive with conflicting blanket From imp…
Alexendoo Apr 26, 2026
da29c3e
[ci] Update GitHub Actions to latest major release (#16915)
flip1995 Apr 27, 2026
d6415a9
Rollup merge of #155702 - mejrs:itemkind_trait-fields, r=petrochenkov
JonathanBrouwer Apr 27, 2026
ff71569
Fix wording for linting instructions in configuration.md
c-git Apr 27, 2026
18e40cb
Adjust diagnostic items for mpmc/mpsc Receiver and Sender
cammeresi Apr 27, 2026
42a0303
Rollup merge of #155854 - cammeresi:20260426-receiver-diag, r=mejrs
jhpratt Apr 28, 2026
5c971e0
`bad_bit_mask` fix ICE for overloaded bit ops
profetia Apr 30, 2026
6e0c7d6
Fix `bad_bit_mask` ICE for overloaded bit ops (#16937)
dswij Apr 30, 2026
7ae3bce
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Apr 30, 2026
8fe8c68
Bump nightly version -> 2026-04-30
flip1995 Apr 30, 2026
09a5b1e
Rustup (#16939)
flip1995 Apr 30, 2026
377417c
Fix wording for linting instructions in configuration.md (#16921)
flip1995 Apr 30, 2026
c397cd3
Merge commit '377417cf68ab671a67af222a551623ce228ce540' into clippy-s…
flip1995 Apr 30, 2026
c9aa8af
Fix Clippy lints in bootstrap
flip1995 Apr 30, 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
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Consider setting `rust.debuginfo-level = 1` in `bootstrap.toml`."#);
apply_shared_opts(&mut cmd, opts);
cmd.run(builder);

println!("You can find the results at `{}`", &results_dir.display());
println!("You can find the results at `{}`", results_dir.display());
}
PerfCommand::Benchmark { id, opts } => {
cmd.arg("bench_local");
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ fn attempt_toolchain_link(builder: &Builder<'_>, stage_path: &str) {
eprintln!(
"To manually link stage 1 build to `stage1` toolchain, run:\n
`rustup toolchain link stage1 {}`",
&stage_path
stage_path
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1349,9 +1349,9 @@ impl Step for Tidy {
/// for the `dev` or `nightly` channels.
fn run(self, builder: &Builder<'_>) {
let mut cmd = builder.tool_cmd(Tool::Tidy);
cmd.arg(format!("--root-path={}", &builder.src.display()));
cmd.arg(format!("--cargo-path={}", &builder.initial_cargo.display()));
cmd.arg(format!("--output-dir={}", &builder.out.display()));
cmd.arg(format!("--root-path={}", builder.src.display()));
cmd.arg(format!("--cargo-path={}", builder.initial_cargo.display()));
cmd.arg(format!("--output-dir={}", builder.out.display()));
// Tidy is heavily IO constrained. Still respect `-j`, but use a higher limit if `jobs` hasn't been configured.
let jobs = builder.config.jobs.unwrap_or_else(|| {
8 * std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get) as u32
Expand Down Expand Up @@ -2576,7 +2576,7 @@ Please disable assertions with `rust.debug-assertions = false`.

builder.info(&format!(
"Check compiletest suite={} mode={} compare_mode={} ({} -> {})",
suite, mode, compare_mode, &test_compiler.host, target
suite, mode, compare_mode, test_compiler.host, target
));
let _time = helpers::timeit(builder);
try_run_tests(builder, &mut cmd, false);
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/.github/workflows/clippy_mq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
find $DIR ! -executable -o -type d ! -path $DIR | xargs rm -rf

- name: Upload Binaries
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: binaries
path: target/debug
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:

# Download
- name: Download target dir
uses: actions/download-artifact@v6
uses: actions/download-artifact@v8
with:
name: binaries
path: target/debug
Expand Down
18 changes: 9 additions & 9 deletions src/tools/clippy/.github/workflows/lintcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Cache lintcheck bin
id: cache-lintcheck-bin
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: target/debug/lintcheck
key: lintcheck-bin-${{ hashfiles('lintcheck/**') }}
Expand All @@ -59,7 +59,7 @@ jobs:

- name: Cache results JSON
id: cache-json
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: lintcheck-logs/ci_crates_logs.json
key: ${{ steps.key.outputs.key }}
Expand All @@ -69,7 +69,7 @@ jobs:
run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml

- name: Upload base JSON
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: base
path: lintcheck-logs/ci_crates_logs.json
Expand All @@ -87,7 +87,7 @@ jobs:

- name: Cache lintcheck bin
id: cache-lintcheck-bin
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: target/debug/lintcheck
key: lintcheck-bin-${{ hashfiles('lintcheck/**') }}
Expand All @@ -100,7 +100,7 @@ jobs:
run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml

- name: Upload head JSON
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: head
path: lintcheck-logs/ci_crates_logs.json
Expand All @@ -119,14 +119,14 @@ jobs:
persist-credentials: false

- name: Restore lintcheck bin
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
with:
path: target/debug/lintcheck
key: lintcheck-bin-${{ hashfiles('lintcheck/**') }}
fail-on-cache-miss: true

- name: Download JSON
uses: actions/download-artifact@v5
uses: actions/download-artifact@v8

- name: Store PR number
run: echo ${{ github.event.pull_request.number }} > pr.txt
Expand All @@ -140,13 +140,13 @@ jobs:
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --write-summary summary.json > full_diff.md

- name: Upload full diff
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: full_diff
path: full_diff.md

- name: Upload summary
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: summary
path: |
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/.github/workflows/lintcheck_summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download artifact
uses: actions/download-artifact@v5
uses: actions/download-artifact@v8
with:
name: summary
path: untrusted
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}

- name: Format comment
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
script: |
const fs = require("fs");
Expand Down
3 changes: 3 additions & 0 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6804,6 +6804,7 @@ Released 2018-09-13
[`inline_asm_x86_att_syntax`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_asm_x86_att_syntax
[`inline_asm_x86_intel_syntax`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_asm_x86_intel_syntax
[`inline_fn_without_body`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_fn_without_body
[`inline_modules`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_modules
[`inspect_for_each`]: https://rust-lang.github.io/rust-clippy/master/index.html#inspect_for_each
[`int_plus_one`]: https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one
[`integer_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
Expand Down Expand Up @@ -6878,6 +6879,7 @@ Released 2018-09-13
[`main_recursion`]: https://rust-lang.github.io/rust-clippy/master/index.html#main_recursion
[`manual_abs_diff`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_abs_diff
[`manual_assert`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_assert
[`manual_assert_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_assert_eq
[`manual_async_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn
[`manual_bits`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits
[`manual_c_str_literals`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_c_str_literals
Expand Down Expand Up @@ -7393,6 +7395,7 @@ Released 2018-09-13
[`used_underscore_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items
[`useless_asref`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
[`useless_attribute`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_attribute
[`useless_borrows_in_formatting`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_borrows_in_formatting
[`useless_concat`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_concat
[`useless_conversion`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
[`useless_format`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This also works with lint groups. For example, you can run Clippy with warnings
cargo clippy -- -W clippy::pedantic
```

If you care only about a certain lints, you can allow all others and then explicitly warn on the lints you are
If you care only about certain lints, you can allow all others and then explicitly warn on the lints you are
interested in:

```terminal
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_dev/src/new_lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> io::Result<&'static str>
file_contents.replace_range(arr_start + 1..arr_end, &new_arr_content);

// Just add the mod declaration at the top, it'll be fixed by rustfmt
file_contents.insert_str(0, &format!("mod {};\n", &lint.name));
file_contents.insert_str(0, &format!("mod {};\n", lint.name));

let mut file = OpenOptions::new()
.write(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,15 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
}
},
ItemKind::Trait {
impl_restriction:_,
constness:_,
impl_restriction: _,
constness: _,
is_auto,
safety:_,
ident:_,
safety: _,
ident: _,
generics: _,
bounds: _,
items: item_ref}
if self.enable_ordering_for_trait && *is_auto == IsAuto::No => {
items: item_ref,
} if self.enable_ordering_for_trait && *is_auto == IsAuto::No => {
let mut cur_t: Option<(TraitItemId, Ident)> = None;

for &item in *item_ref {
Expand Down
7 changes: 4 additions & 3 deletions src/tools/clippy/clippy_lints/src/bool_assert_comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ use clippy_utils::source::walk_span_to_context;
use clippy_utils::sugg::Sugg;
use clippy_utils::sym;
use clippy_utils::ty::{implements_trait, is_copy};
use rustc_middle::ty::Unnormalized;
use rustc_ast::ast::LitKind;
use rustc_errors::Applicability;
use rustc_hir::{Expr, ExprKind, Lit};
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_middle::ty::{self, Ty};
use rustc_middle::ty::{self, Ty, Unnormalized};
use rustc_session::declare_lint_pass;
use rustc_span::symbol::Ident;

Expand Down Expand Up @@ -65,7 +64,9 @@ fn is_impl_not_trait_with_bool_out<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -
})
.is_some_and(|assoc_item| {
let proj = Ty::new_projection(cx.tcx, assoc_item.def_id, cx.tcx.mk_args_trait(ty, []));
let nty = cx.tcx.normalize_erasing_regions(cx.typing_env(), Unnormalized::new_wip(proj));
let nty = cx
.tcx
.normalize_erasing_regions(cx.typing_env(), Unnormalized::new_wip(proj));

nty.is_bool()
})
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/booleans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ impl SuggestContext<'_, '_, '_> {
if app != Applicability::MachineApplicable {
return None;
}
let _cannot_fail = write!(&mut self.output, "{}", &(!snip));
let _cannot_fail = write!(&mut self.output, "{}", !snip);
}
},
True | False | Not(_) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ fn is_used_as_unaligned(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
if matches!(name.ident.name, sym::read_unaligned | sym::write_unaligned)
&& let Some(def_id) = cx.typeck_results().type_dependent_def_id(parent.hir_id)
&& let Some(def_id) = cx.tcx.impl_of_assoc(def_id)
&& cx.tcx.type_of(def_id).instantiate_identity().skip_norm_wip().is_raw_ptr()
&& cx
.tcx
.type_of(def_id)
.instantiate_identity()
.skip_norm_wip()
.is_raw_ptr()
{
true
} else {
Expand Down
Loading
Loading