about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-10make `never_loop` applicability more flexiblelapla-cogito-5/+193
2025-02-21rename `MANUAL_DIV_CEIL` MSRV alias and add missing conf info for ↵Alejandra González-2/+4
`manual_div_ceil` (#14263) - The name of an MSRV alias should describe its functionality, and it is not appropriate for it to be the same as the name of the lint that uses it. - Additionally, while `manual_div_ceil` allows setting MSRV, this is not correctly reflected in the configuration information. changelog: none
2025-02-21Represent the capability instead of the lint name in msrv aliases (#14269)Timo-2/+2
`INTEGER_BITS` better represents the addition of the `BITS` value on the primitive integer types. Inspired by #14263 changelog: none
2025-02-21Represent the capability instead of the lint name in msrv aliasesSamuel Tardieu-2/+2
`INTEGER_BITS` better represents the addition of the `BITS` value on the primitive integer types.
2025-02-20Remove obsolete comment and simplify code (#14264)Manish Goregaokar-20/+14
The `IoBufRead` diagnostic has been added during the latest rustup. changelog: none
2025-02-20Remove obsolete comment and simplify codeSamuel Tardieu-20/+14
The `IoBufRead` diagnostic has been added during the latest rustup.
2025-02-20Rustup (#14262)Philipp Krones-2467/+3505
r? @ghost changelog: none
2025-02-20Rustup: fix 32bit testsPhilipp Krones-48/+72
2025-02-20add `owned_cow` lint (#13948)Timo-96/+315
Closes #13697. --- changelog: add [`owned_cow`] lint
2025-02-20Changelog for Clippy 1.85 🦜 (#14229)Fridtjof Stoldt-6/+48
Roses are red, Biolets are blue, A typo happened, too late now You might be asking, what are Biolets now? And to be honest, I have no clue --- The cat of this release is `Vera` nominated by @and-reas-se <img height=500 src="https://github.com/user-attachments/assets/82e6fccc-1f6d-4d29-b6bb-0bd4f3584593" alt="The cats of this Clippy release" /> Cats for the next release can be nominated in the comments :D --- changelog: none
2025-02-20Bump nightly version -> 2025-02-20Philipp Krones-2/+2
2025-02-20add missing MSRV configuration information for `manual_div_ceil`lapla-cogito-0/+2
2025-02-20Bump Clippy version -> 0.1.87Philipp Krones-4/+4
2025-02-20rename the MSRV alias `MANUAL_DIV_CEIL` to `DIV_CEIL`lapla-cogito-2/+2
2025-02-20Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-13930/+31634
2025-02-19add `owned_cow` lintAndre Bogus-96/+315
2025-02-19fix: `map_entry` FP on struct member (#14151)Catherine Flores-1/+62
fixes #13934 I modified the part for checking if the map is used so that it can check field and index exprs. changelog: [`map_entry`]: fix FP on struct member
2025-02-19`.last()` to `.next_back()` requires a mutable receiver (#14140)Catherine Flores-33/+272
In the case where `iter` is a `DoubleEndedIterator`, replacing a call to `iter.last()` (which consumes `iter`) by `iter.next_back()` (which requires a mutable reference to `iter`) cannot be done when `iter` is a non-mutable binding which is not a mutable reference. When possible, a local immutable binding is made into a mutable one. Also, the applicability is switched to `MaybeIncorrect` and a note is added to the output when the element types have a significant drop, because the drop order will potentially be modified because `.next_back()` does not consume the iterator nor the elements before the last one. Fix #14139 changelog: [`double_ended_iterator_last`]: do not trigger on non-reference immutable receiver, and warn about possible drop order change
2025-02-19update `rustfix` link in docs (#14248)Philipp Krones-2/+2
Since `rustfix` was moved to `@rust-lang/cargo`, the old link may be confusing for readers. changelog: none r? flip1995
2025-02-19`double_ended_iterator_last`: note when drop order is changedSamuel Tardieu-2/+82
`iter.last()` will drop all elements of `iter` in order, while `iter.next_back()` will drop the non-last elements of `iter` when `iter` goes out of scope since `.next_back()` does not consume its argument. When the transformation proposed by `double_ended_iterator_last` would concern an iterator whose element type has a significant drop, a note is added to warn about the possible drop order change, and the suggestion is switched from `MachineApplicable` to `MaybeIncorrect`.
2025-02-19fix: `map_entry` FP on struct memberyanglsh-1/+62
2025-02-18add a preferred fix for `cast_possible_wrap` description (#14225)Alejandra González-1/+7
close #9250 changelog: none
2025-02-19update `rustfix` linklapla-cogito-2/+2
2025-02-18remove an unneeded `#![feature]` (#14245)Alejandra González-1/+0
It seems as if `#![feature(binary_heap_into_iter_sorted)]` is not required anymore. changelog: none
2025-02-18`.last()` to `.next_back()` requires a mutable receiverSamuel Tardieu-21/+169
In the case where `iter` is a `DoubleEndedIterator`, replacing a call to `iter.last()` (which consumes `iter`) by `iter.next_back()` (which requires a mutable reference to `iter`) cannot be done when `iter` Is not a mutable binding or a mutable reference. When `iter` is a local binding, it can be made mutable by fixing its definition site.
2025-02-18remove an unneeded `#![feature]`cyrgani-1/+0
2025-02-17fix: `needless_option_as_deref` FP in trait (#14210)Alejandra González-1/+31
fixes #14148 Another case of #13077 and #8646 changelog: [`needless_option_as_deref`]: fix FP in trait
2025-02-18Move methods from `Map` to `TyCtxt`, part 2.Nicholas Nethercote-45/+37
Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that.
2025-02-17Update mention of `ref_to_mut` to `invalid_reference_casting` (#14241)Manish Goregaokar-6/+18
This lint was renamed in 50da77521e922f17735b9d97461925ca0f3dec1c. While I'm here convert the list of separate lints into a proper list for ease of use. changelog: none
2025-02-17`manual_ok_err`: blockify the replacement of an `else if …` (#14240)Manish Goregaokar-3/+52
If the part being replaced is an `if` expression following an `else`, the replacement expression must be blockified. Fix #14239 changelog: [`manual_ok_err`]: fix replacement expression if it follows an `else`
2025-02-17Update mention of `ref_to_mut` to `invalid_reference_casting`Tamir Duberstein-6/+18
This lint was renamed in 50da77521e922f17735b9d97461925ca0f3dec1c. While I'm here convert the list of separate lints into a proper list for ease of use and clarify which lints are in clippy and which are in rustc.
2025-02-17`manual_ok_err`: blockify the replacement of an `else if …`Samuel Tardieu-3/+52
If the part being replaced is an `if` expression following an `else`, the replacement expression must be blockified.
2025-02-17"Typo Catch Check" passed by @flip1995 Fridtjof Stoldt-1/+1
This was *totally* intentional to check if this would get caught :P Co-authored-by: Philipp Krones <hello@philkrones.com>
2025-02-17Add `cargo dev setup toolchain --standalone` (#14230)Philipp Krones-8/+39
Allows creating a toolchain that's independent of the local build, for example to make two separate toolchains with slight differences without requiring two checkouts of clippy changelog: none
2025-02-17Add `--allow-no-vcs` to `cargo dev dogfood --fix` (#14227)Philipp Krones-2/+11
Some developers might prefer to use alternate VCS, such as Jujutsu, which are not detected by `cargo fix`. This forwards the `--allow-no-vcs` command line argument to `cargo fix`. changelog: none
2025-02-17Rollup merge of #137101 - GrigorenkoPV:str-inherent-lint, r=UrgauMatthias Krüger-4/+5
`invalid_from_utf8[_unchecked]`: also lint inherent methods Addressing https://github.com/rust-lang/rust/issues/131114#issuecomment-2646663535 Also corrected a typo: "_an_ invalid literal", not "_a_ invalid literal".
2025-02-17Overhaul the `intravisit::Map` trait.Nicholas Nethercote-64/+61
First of all, note that `Map` has three different relevant meanings. - The `intravisit::Map` trait. - The `map::Map` struct. - The `NestedFilter::Map` associated type. The `intravisit::Map` trait is impl'd twice. - For `!`, where the methods are all unreachable. - For `map::Map`, which gets HIR stuff from the `TyCtxt`. As part of getting rid of `map::Map`, this commit changes `impl intravisit::Map for map::Map` to `impl intravisit::Map for TyCtxt`. It's fairly straightforward except various things are renamed, because the existing names would no longer have made sense. - `trait intravisit::Map` becomes `trait intravisit::HirTyCtxt`, so named because it gets some HIR stuff from a `TyCtxt`. - `NestedFilter::Map` assoc type becomes `NestedFilter::MaybeTyCtxt`, because it's always `!` or `TyCtxt`. - `Visitor::nested_visit_map` becomes `Visitor::maybe_tcx`. I deliberately made the new trait and associated type names different to avoid the old `type Map: Map` situation, which I found confusing. We now have `type MaybeTyCtxt: HirTyCtxt`.
2025-02-17Move some `Map` methods onto `TyCtxt`.Nicholas Nethercote-150/+146
The end goal is to eliminate `Map` altogether. I added a `hir_` prefix to all of them, that seemed simplest. The exceptions are `module_items` which became `hir_module_free_items` because there was already a `hir_module_items`, and `items` which became `hir_free_items` for consistency with `hir_module_free_items`.
2025-02-16`ui_test` annotation cleanup (#14232)Alex Macleod-355/+340
Cleans up some changes from https://github.com/rust-lang/rust-clippy/pull/11421 I searched for any `.stderr` files where the number of errors changed and reverted + manually added the annotations for them Also fixes `tests/ui/asm_syntax_not_x86.rs` r? @flip1995 changelog: none
2025-02-16`ui_test` annotation cleanupAlex Macleod-355/+340
2025-02-16Add `cargo dev setup toolchain --standalone`Alex Macleod-8/+39
2025-02-16clippy: string_from_utf8_as_bytes: also detect inherent `from_utf8`Pavel Grigorenko-4/+5
2025-02-16Changelog for Clippy 1.85 :parrot:xFrednet-2/+44
2025-02-16Update version attribute for 1.85 clippy lintsxFrednet-4/+4
2025-02-16Add `--allow-no-vcs` to `cargo dev dogfood --fix`Samuel Tardieu-2/+11
Some developers might prefer to use alternate VCS, such as Jujutsu, which are not detected by `cargo fix`. This forwards the `--allow-no-vcs` command line argument to `cargo fix`.
2025-02-16add suggestion example for `cast_possible_wrap`lapla-cogito-1/+7
2025-02-15new lint: `manual_contains` (#13817)Manish Goregaokar-29/+459
close #13353 Using `contains()` for slices are more efficient than using `iter().any()`. changelog: [`manual_contains`]: new lint
2025-02-16apply `manual_contains` to Clippy sourceslapla-cogito-4/+4
2025-02-16add `manual_contains` lintlapla-cogito-25/+455
2025-02-15Use `clippy_utils::is_mutable()` in `unnecessary_struct_initialization`Samuel Tardieu-12/+2