Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
ce42656
make the suggestions verbose
ada4a Oct 9, 2025
7b83f42
fix(match_like_matches_macro): don't create `matches!` with if-let gu…
ada4a Oct 9, 2025
3833ac3
misc: use `Symbol`s instead of `&str`s
ada4a Oct 8, 2025
95834c9
recognize `x.checked_sub(y).unwrap_or_default()` as well
ada4a Oct 8, 2025
96ac099
fix: `nonstandard_macro_braces` FN on macros with empty args
profetia Sep 1, 2025
f4496bf
Fix suggestions in while_let_on_iterator for non-sized traits
sergiogiro Nov 16, 2025
6a14a52
clean-up: pass things by value to avoid copying
ada4a Nov 20, 2025
9ced0f5
use `note_once`
ada4a Nov 20, 2025
4b021f6
point the suggestion at each individual span
ada4a Nov 20, 2025
f3b905d
use `span_suggestion_verbose`
ada4a Nov 20, 2025
129a39d
fix: adjust the applicability for the suggestion
ada4a Nov 20, 2025
e6ad406
feat(manual_ilog2): new lint
ada4a Oct 11, 2025
110649f
Fix display of dropdown menu "buttons"
GuillaumeGomez Nov 28, 2025
099308a
Merge commit '92b4b68683249c781c3acad742fc6e57c4140ad9' into clippy-s…
flip1995 Nov 28, 2025
bbadb72
while_let_on_iterator: consider all deref adjustments for by_ref
sergiogiro Nov 29, 2025
9cb6306
New lint: decimal_bitwise_operands
Artur-Sulej Nov 23, 2025
2c95550
New lint: `decimal_bitwise_operands` (#15215)
llogiq Nov 29, 2025
a6162c3
add `ptr_offset_by_literal` lint
folkertdev Sep 3, 2025
65c339e
add `ptr_offset_by_literal` lint (#15606)
llogiq Nov 30, 2025
d706368
Changelog for Clippy 1.92
alex-semenyuk Nov 30, 2025
3e88c6a
stabilize [T]::array_windows
bend-n Nov 11, 2025
1b76a34
fix: `large_stack_frames` FP on compiler generated targets
profetia Jun 22, 2025
21c5ddd
Fix `large_stack_frames` FP on compiler generated targets (#15101)
blyxyas Dec 1, 2025
5ac2656
feat(transmute_ptr_to_ref): Handle a pointer wrapped in a struct
Oct 24, 2025
e9ceae4
feat(transmute_ptr_to_ptr): Handle a pointer wrapped in a struct
Dec 1, 2025
e4b8c5a
fix: `useless_conversion` wrongly unmangled macros
profetia Dec 1, 2025
b07013c
chore: Update annotate-snippets to 0.12.10
Muscraft Dec 1, 2025
9c0cbe9
Merge E0412 into E0425
xonx4l Nov 7, 2025
28eb74b
Fix display of dropdown menu "buttons" (#16151)
Alexendoo Dec 2, 2025
a10cafe
feat(manual_ilog2): new lint (#15865)
Alexendoo Dec 2, 2025
f2af204
fix: `zero_repeat_side_effects` misses curlies
profetia Oct 9, 2025
4180830
Fix: `zero_repeat_side_effects` misses curlies (#15853)
blyxyas Dec 2, 2025
270e88d
Rollup merge of #148678 - xonx4l:EO412_replacement_with_EO425, r=Kivooeo
matthiaskrgr Dec 2, 2025
7f61da9
account for safe target features in fndef<->closure and fndef<->fndef…
BoxyUwU Oct 28, 2025
298d13e
Revert "fixup warnings around the compiler"
jdonszelmann Dec 3, 2025
680a336
Remove myself from rotation
blyxyas Dec 3, 2025
6885741
Remove myself from rotation (#16187)
blyxyas Dec 3, 2025
d501df0
Rollup merge of #149597 - jdonszelmann:revert-iterator-exactly-one, r…
matthiaskrgr Dec 4, 2025
db927a0
Auto merge of #148602 - BoxyUwU:coercion_cleanup_uncontroversial, r=lcnr
bors Dec 5, 2025
a27bd22
clean-up
ada4a Dec 5, 2025
d6b5613
fix(len_without_is_empty): allow `is_empty(&self)` with `len(&mut self)`
ada4a Dec 5, 2025
28c1eec
fix(len_without_is_empty): allow `is_empty(&self)` with `len(&mut sel…
llogiq Dec 5, 2025
2081b7a
chore(len_without_is_empty): extract to a separate module
ada4a Dec 5, 2025
64f43bf
chore(len_without_is_empty): extract to a separate module (#16195)
llogiq Dec 5, 2025
c905503
fix: `panicking_unwrap` FP on field access with implicit deref
profetia Dec 5, 2025
c59e7a9
Fix `panicking_unwrap` FP on field access with implicit deref (#16196)
llogiq Dec 5, 2025
f81cf11
Rollup merge of #148814 - bend-n:stabilize_array_windows, r=scottmcm
matthiaskrgr Dec 6, 2025
c788c7c
Fix `map_entry` FP when it would cause `MutexGuard` to be held across an
relaxcn Dec 6, 2025
8cc9c5e
Add warn-by-default lint for visibility on `const _` declarations
Jules-Bertholet Sep 28, 2025
5a37f7b
Fix `map_entry` FP when it would cause `MutexGuard` to be held across…
llogiq Dec 6, 2025
9e970d7
Fix `useless_conversion` wrongly unmangled macros (#16171)
dswij Dec 7, 2025
6278cc8
Fix `nonstandard_macro_braces` FN on macros with empty args (#15601)
dswij Dec 8, 2025
d5d644f
refactor(missing_asserts_for_indexing): overhaul diagnostics (#16120)
Jarcho Dec 8, 2025
4648af6
Remove `[no-mentions]` handler in our triagebot config
Urgau Dec 8, 2025
66ebabe
Remove `[no-mentions]` handler in our triagebot config (#16206)
samueltardieu Dec 9, 2025
70a4d95
Fixes #16109: For non-sized types, use reborrow in suggestions to rem…
Jarcho Dec 9, 2025
3551aeb
fix: `tuple_array_conversions` FP when binded vars are used before co…
profetia Dec 5, 2025
94aa13a
Recognize `type Alias = dyn Trait` in `fn` return types
estebank Nov 4, 2025
52fea21
Fix `tuple_array_conversions` FP when binded vars are used before con…
Jarcho Dec 9, 2025
d0e4b5b
Fix typo in deprecated lint `string_to_string` message
relaxcn Dec 9, 2025
0cf51b1
Fix typo in deprecated lint `string_to_string` message (#16208)
llogiq Dec 9, 2025
1232c81
Add needless_type_cast lint
borngraced Dec 9, 2025
8293d5e
Add `needless_type_cast` lint (#16139)
llogiq Dec 9, 2025
9495686
Update clippy for the ast `TryBlock` change
scottmcm Nov 30, 2025
c47bc5d
Remove ICE fix that was already backported to 1.91
flip1995 Dec 10, 2025
5357257
Changelog for Clippy 1.92⛸️ (#16158)
flip1995 Dec 10, 2025
16eaf79
feat(transmute_ptr_to_ref): Handle a pointer wrapped in a struct (#15…
Alexendoo Dec 10, 2025
06ded88
fix(match_like_matches_macro): FP with guards containing `if let` (#1…
Alexendoo Dec 10, 2025
961ea1c
feat(manual_saturating_arithmetic): lint `x.checked_sub(y).unwrap_or_…
Alexendoo Dec 10, 2025
d196db7
Rollup merge of #149489 - scottmcm:try-bikeshed, r=nnethercote
matthiaskrgr Dec 10, 2025
de365c0
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Dec 11, 2025
42c8b68
Bump nightly version -> 2025-12-11
flip1995 Dec 11, 2025
1ff4682
Bump Clippy version -> 0.1.94
flip1995 Dec 11, 2025
9e3e964
Rustup (#16217)
flip1995 Dec 11, 2025
39877b1
Merge commit '9e3e9649cbae7ed33ba62ca436f43081eaaedeb5' into clippy-s…
flip1995 Dec 11, 2025
26c164f
Update Cargo.lock
flip1995 Dec 11, 2025
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
10 changes: 5 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"

[[package]]
name = "clippy"
version = "0.1.93"
version = "0.1.94"
dependencies = [
"anstream",
"askama",
Expand All @@ -648,7 +648,7 @@ dependencies = [

[[package]]
name = "clippy_config"
version = "0.1.93"
version = "0.1.94"
dependencies = [
"clippy_utils",
"itertools",
Expand All @@ -671,7 +671,7 @@ dependencies = [

[[package]]
name = "clippy_lints"
version = "0.1.93"
version = "0.1.94"
dependencies = [
"arrayvec",
"cargo_metadata 0.18.1",
Expand Down Expand Up @@ -703,7 +703,7 @@ dependencies = [

[[package]]
name = "clippy_utils"
version = "0.1.93"
version = "0.1.94"
dependencies = [
"arrayvec",
"itertools",
Expand Down Expand Up @@ -1107,7 +1107,7 @@ dependencies = [

[[package]]
name = "declare_clippy_lint"
version = "0.1.93"
version = "0.1.94"

[[package]]
name = "derive-where"
Expand Down
83 changes: 82 additions & 1 deletion src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,83 @@ document.

## Unreleased / Beta / In Rust Nightly

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

## Rust 1.92

Current stable, released 2025-12-11

[View all 124 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2025-09-05T18%3A24%3A03Z..2025-10-16T14%3A13%3A43Z+base%3Amaster)

### New Lints

* Added [`unnecessary_option_map_or_else`] to `suspicious`
[#14662](https://github.com/rust-lang/rust-clippy/pull/14662)
* Added [`replace_box`] to `perf`
[#14953](https://github.com/rust-lang/rust-clippy/pull/14953)
* Added [`volatile_composites`] to `nursery`
[#15686](https://github.com/rust-lang/rust-clippy/pull/15686)
* Added [`self_only_used_in_recursion`] to `pedantic`
[#14787](https://github.com/rust-lang/rust-clippy/pull/14787)
* Added [`redundant_iter_cloned`] to `perf`
[#15277](https://github.com/rust-lang/rust-clippy/pull/15277)

### Moves and Deprecations

* Renamed [`unchecked_duration_subtraction`] to [`unchecked_time_subtraction`]
[#13800](https://github.com/rust-lang/rust-clippy/pull/13800)

### Enhancements

* [`mutex_atomic`] and [`mutex_integer`] overhauled to only lint definitions, not uses; added suggestions
and better help messages
[#15632](https://github.com/rust-lang/rust-clippy/pull/15632)
* [`manual_rotate`] now recognizes non-const rotation amounts
[#15402](https://github.com/rust-lang/rust-clippy/pull/15402)
* [`multiple_inherent_impl`] added `inherent-impl-lint-scope` config option (`module`, `file`,
or `crate`)
[#15843](https://github.com/rust-lang/rust-clippy/pull/15843)
* [`use_self`] now checks structs and enums
[#15566](https://github.com/rust-lang/rust-clippy/pull/15566)
* [`while_let_loop`] extended to lint on `loop { let else }`
[#15701](https://github.com/rust-lang/rust-clippy/pull/15701)
* [`mut_mut`] overhauled with structured suggestions and improved documentation
[#15417](https://github.com/rust-lang/rust-clippy/pull/15417)
* [`nonstandard_macro_braces`] now suggests trailing semicolon when needed
[#15593](https://github.com/rust-lang/rust-clippy/pull/15593)
* [`ptr_offset_with_cast`] now respects MSRV when suggesting fix, and lints more cases
[#15613](https://github.com/rust-lang/rust-clippy/pull/15613)
* [`cast_sign_loss`] and [`cast_possible_wrap`] added suggestions using `cast_{un,}signed()` methods
(MSRV 1.87+)
[#15384](https://github.com/rust-lang/rust-clippy/pull/15384)
* [`unchecked_time_subtraction`] extended to include `Duration - Duration` operations
[#13800](https://github.com/rust-lang/rust-clippy/pull/13800)
* [`filter_next`] now suggests replacing `filter().next_back()` with `rfind()` for
`DoubleEndedIterator`
[#15748](https://github.com/rust-lang/rust-clippy/pull/15748)

### False Positive Fixes

* [`unnecessary_safety_comment`] fixed FPs with comments above attributes
[#15678](https://github.com/rust-lang/rust-clippy/pull/15678)
* [`manual_unwrap_or`] fixed FP edge case
[#15812](https://github.com/rust-lang/rust-clippy/pull/15812)
* [`needless_continue`] fixed FP when match type is not unit or never
[#15547](https://github.com/rust-lang/rust-clippy/pull/15547)
* [`if_then_some_else_none`] fixed FP when return exists in block expr
[#15783](https://github.com/rust-lang/rust-clippy/pull/15783)
* [`new_without_default`] fixed to copy `#[cfg]` onto `impl Default` and fixed FP on private type
with trait impl
[#15720](https://github.com/rust-lang/rust-clippy/pull/15720)
[#15782](https://github.com/rust-lang/rust-clippy/pull/15782)
* [`question_mark`] fixed FP on variables used after
[#15644](https://github.com/rust-lang/rust-clippy/pull/15644)
* [`needless_return`] fixed FP with `cfg`d code after `return`
[#15669](https://github.com/rust-lang/rust-clippy/pull/15669)
* [`useless_attribute`] fixed FP on `deprecated_in_future`
[#15645](https://github.com/rust-lang/rust-clippy/pull/15645)
* [`double_parens`] fixed FP when macros are involved
[#15420](https://github.com/rust-lang/rust-clippy/pull/15420)

## Rust 1.91

Expand Down Expand Up @@ -6280,6 +6356,7 @@ Released 2018-09-13
[`cyclomatic_complexity`]: https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity
[`dbg_macro`]: https://rust-lang.github.io/rust-clippy/master/index.html#dbg_macro
[`debug_assert_with_mut_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#debug_assert_with_mut_call
[`decimal_bitwise_operands`]: https://rust-lang.github.io/rust-clippy/master/index.html#decimal_bitwise_operands
[`decimal_literal_representation`]: https://rust-lang.github.io/rust-clippy/master/index.html#decimal_literal_representation
[`declare_interior_mutable_const`]: https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
[`default_constructed_unit_structs`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
Expand Down Expand Up @@ -6541,6 +6618,7 @@ Released 2018-09-13
[`manual_flatten`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
[`manual_hash_one`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_hash_one
[`manual_ignore_case_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ignore_case_cmp
[`manual_ilog2`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ilog2
[`manual_inspect`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
[`manual_instant_elapsed`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_instant_elapsed
[`manual_is_ascii_check`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check
Expand Down Expand Up @@ -6686,6 +6764,7 @@ Released 2018-09-13
[`needless_return`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
[`needless_return_with_question_mark`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_return_with_question_mark
[`needless_splitn`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_splitn
[`needless_type_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_type_cast
[`needless_update`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_update
[`neg_cmp_op_on_partial_ord`]: https://rust-lang.github.io/rust-clippy/master/index.html#neg_cmp_op_on_partial_ord
[`neg_multiply`]: https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply
Expand Down Expand Up @@ -6765,6 +6844,7 @@ Released 2018-09-13
[`ptr_as_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
[`ptr_cast_constness`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness
[`ptr_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq
[`ptr_offset_by_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_by_literal
[`ptr_offset_with_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
[`pub_enum_variant_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#pub_enum_variant_names
[`pub_underscore_fields`]: https://rust-lang.github.io/rust-clippy/master/index.html#pub_underscore_fields
Expand Down Expand Up @@ -7081,6 +7161,7 @@ Released 2018-09-13
[`allow-expect-in-consts`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-expect-in-consts
[`allow-expect-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-expect-in-tests
[`allow-indexing-slicing-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-indexing-slicing-in-tests
[`allow-large-stack-frames-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-large-stack-frames-in-tests
[`allow-mixed-uninlined-format-args`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-mixed-uninlined-format-args
[`allow-one-hash-in-raw-strings`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-one-hash-in-raw-strings
[`allow-panic-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-panic-in-tests
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.1.93"
version = "0.1.94"
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.

[There are over 750 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
[There are over 800 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)

Lints are divided into categories, each with a default [lint level](https://doc.rust-lang.org/rustc/lints/levels.html).
You can choose how much Clippy is supposed to ~~annoy~~ help you by changing the lint level by category.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
A collection of lints to catch common mistakes and improve your
[Rust](https://github.com/rust-lang/rust) code.

[There are over 750 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
[There are over 800 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)

Lints are divided into categories, each with a default [lint
level](https://doc.rust-lang.org/rustc/lints/levels.html). You can choose how
Expand Down
10 changes: 10 additions & 0 deletions src/tools/clippy/book/src/lint_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ Whether `indexing_slicing` should be allowed in test functions or `#[cfg(test)]`
* [`indexing_slicing`](https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing)


## `allow-large-stack-frames-in-tests`
Whether functions inside `#[cfg(test)]` modules or test functions should be checked.

**Default Value:** `true`

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


## `allow-mixed-uninlined-format-args`
Whether to allow mixed uninlined format args, e.g. `format!("{} {}", a, foo.bar)`

Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy_config"
version = "0.1.93"
version = "0.1.94"
edition = "2024"
publish = false

Expand Down
3 changes: 3 additions & 0 deletions src/tools/clippy/clippy_config/src/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ define_Conf! {
/// Whether `indexing_slicing` should be allowed in test functions or `#[cfg(test)]`
#[lints(indexing_slicing)]
allow_indexing_slicing_in_tests: bool = false,
/// Whether functions inside `#[cfg(test)]` modules or test functions should be checked.
#[lints(large_stack_frames)]
allow_large_stack_frames_in_tests: bool = true,
/// Whether to allow mixed uninlined format args, e.g. `format!("{} {}", a, foo.bar)`
#[lints(uninlined_format_args)]
allow_mixed_uninlined_format_args: bool = true,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy_lints"
version = "0.1.93"
version = "0.1.94"
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand Down
32 changes: 32 additions & 0 deletions src/tools/clippy/clippy_lints/src/casts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ mod fn_to_numeric_cast;
mod fn_to_numeric_cast_any;
mod fn_to_numeric_cast_with_truncation;
mod manual_dangling_ptr;
mod needless_type_cast;
mod ptr_as_ptr;
mod ptr_cast_constness;
mod ref_as_ptr;
Expand Down Expand Up @@ -813,6 +814,32 @@ declare_clippy_lint! {
"casting a primitive method pointer to any integer type"
}

declare_clippy_lint! {
/// ### What it does
/// Checks for bindings (constants, statics, or let bindings) that are defined
/// with one numeric type but are consistently cast to a different type in all usages.
///
/// ### Why is this bad?
/// If a binding is always cast to a different type when used, it would be clearer
/// and more efficient to define it with the target type from the start.
///
/// ### Example
/// ```no_run
/// const SIZE: u16 = 15;
/// let arr: [u8; SIZE as usize] = [0; SIZE as usize];
/// ```
///
/// Use instead:
/// ```no_run
/// const SIZE: usize = 15;
/// let arr: [u8; SIZE] = [0; SIZE];
/// ```
#[clippy::version = "1.93.0"]
pub NEEDLESS_TYPE_CAST,
pedantic,
"binding defined with one type but always cast to another"
}

pub struct Casts {
msrv: Msrv,
}
Expand Down Expand Up @@ -851,6 +878,7 @@ impl_lint_pass!(Casts => [
AS_POINTER_UNDERSCORE,
MANUAL_DANGLING_PTR,
CONFUSING_METHOD_TO_NUMERIC_CAST,
NEEDLESS_TYPE_CAST,
]);

impl<'tcx> LateLintPass<'tcx> for Casts {
Expand Down Expand Up @@ -920,4 +948,8 @@ impl<'tcx> LateLintPass<'tcx> for Casts {
cast_slice_different_sizes::check(cx, expr, self.msrv);
ptr_cast_constness::check_null_ptr_cast_method(cx, expr);
}

fn check_body(&mut self, cx: &LateContext<'tcx>, body: &rustc_hir::Body<'tcx>) {
needless_type_cast::check(cx, body);
}
}
Loading
Loading