Closesrust-lang/rust-clippy#14598
Implemented checks for simple enum variants when checking if match arms
are disjointed.
changelog: [`manual_let_else`] fix FN when diverges on simple enum
variant
changelog: [`unwrap_used`, `expect_used`]: lint even when the receiver
is a macro expansion result
This also paves the way for expanding more method call lints to expanded
receivers or arguments.
Fixesrust-lang/rust-clippy#13455
fixrust-lang/rust-clippy#13637
As suggested in the PR above, we should not lint enum variants
containing matching path names.
changelog: [`item_name_repetitions`]: exclude enum variants with
identical path components
The MSRV being for crates targeting 1.85-1.87 on edition 2024
This enables the lint for regular nightly users without the feature gate
enabled
r? @samueltardieu
Fixes https://github.com/rust-lang/rust-clippy/issues/14678
changelog: none
Closesrust-lang/rust-clippy#14577.
Migrate this lint to late pass and avoids `unit_never_type_fallback`
since it is no longer permitted in Rust 2024.
changelog: [`unused_unit`] fix wrong suggestions when unit never type
fallback
here is my small fix
changelog: fix suggestion span to avoid showing macro name in
`.div_ceil()` suggestion
i changed this line
`let divisor_snippet = snippet_with_applicability(cx,
rhs.spansource_callsite(), "..", applicability);`
to this line
`let divisor_snippet = snippet_with_applicability(cx, rhs.span, "..",
applicability);`
to fix problem where this warning in macro expands like this
```rust
4 | let _ = (x + 7) / 8;
| ^^^^^^^^^^^ help: consider using `.div_ceil()`: `x.div_ceil(y!())`
```
[play it
yourself](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=397aa8cd2ffffb24a286fbddbc75446c)
as you can see here it looks like `x.div_ceil(y!())` and contains macro
signature
so i fixed this problem, i will look closely if there any more problems
like this and fix them in order
**Related issue**
fixes
[rust-lang/rust-clippy#14665](https://github.com/rust-lang/rust-clippy/issues/14665)
`ptr_eq` was recently enhanced to lint on more cases of raw pointers
comparison:
- lint on all raw pointer comparison, by proposing to use
`[core|std]::ptr::eq(lhs, rhs)` instead of `lhs == rhs`;
- removing one symetric `as usize` on each size if needed
- peeling any level of `as *[const|mut] _` if the remaining expression
can still be coerced into the original one (i.e., is a ref or raw
pointer to the same type as before)
The current change restricts the lint to the cases where at least one
level of symetric `as usize`, or any conversion to a raw pointer, could
be removed. For example, a direct comparaison of two raw pointers will
not trigger the lint anymore.
changelog: [`ptr_eq`]: do not lint when comparing two raw pointers
directly with no casts involved
Fixesrust-lang/rust-clippy#14525
Closes#9191Closes#14444Closes#8055
Adds a new helper to partly check for side effects by recursively
checking if the iterator type contains closures with mutable captures.
changelog: [`double_ended_iterator_last`] fix FP when iter has side
effects
changelog: [`needless_collect`] fix lint not consider side effects
While I like replacing `&x` by `&raw const x` and `&mut x` by `&raw mut
x`, I'm less sure I like the suggested reborrows such as `&raw const
*p`. There was one in Clippy sources, see the PR diff.
@RalfJung, any opinion on this?
Fix#14406
changelog: [`borrow_as_ptr`]: lint implicit casts as well