Additionally removed the comment about MIR const propagation as it is
now outdated
changelog: [`transmuting_null`]: now checks const integers being casted
to pointers
Fixesrust-lang/rust-clippy#5955
I understand that there's a feature freeze right now. I had started
working on this before I was aware of the feature freeze. I don't mind
waiting as long as I need to for feedback.
changelog: [`same_length_and_capacity`]: adds a new lint that checks for
usages of `from_raw_parts` where the same expression is passed for the
length and the capacity
<!-- TRIAGEBOT_START -->
<!-- TRIAGEBOT_SUMMARY_START -->
### Summary Notes
-
[Feature-freeze](https://github.com/rust-lang/rust-clippy/pull/15656#issuecomment-3276620004)
by [github-actions[bot]](https://github.com/github-actions[bot])
*Managed by `@rustbot`—see
[help](https://forge.rust-lang.org/triagebot/note.html) for details*
<!-- TRIAGEBOT_SUMMARY_END -->
<!-- TRIAGEBOT_END -->
When the initializer is a function call or suffixed literal (e.g.,
`size_of::<T>()` or `10u8`), suggest casting the initializer too, since
changing only the type annotation would fail to compile. Fixes
rust-lang/rust-clippy#16240
```
changelog: [`needless_type_cast`]: Fix suggesting invalid code for non-literal initializers
```
This commit is put before the one that actually introduces the lint,
since, were they put in the opposite order, the first commit wouldn't
pass dogfood
The `Fn`/`AssocFn` cases were not tested anywhere, and according to the
comments inside `TyCtxt::res_generic_def_id()` could have made the
`TyCtxt::generics_of()` call also trigger an ICE.
changelog: [`needless_type_cast`]: do not ICE on struct constructor
Fixesrust-lang/rust-clippy#16243
Also, the `Fn`/`AssocFn` cases were not tested anywhere, and according
to the comments inside `TyCtxt::res_generic_def_id()` could have made
the `TyCtxt::generics_of()` call also trigger an ICE.
changelog: [`multiple_unsafe_ops_per_block`]: count unsafe operations
only towards the innermost unsafe block
Fixesrust-lang/rust-clippy#16116
r? Jarcho
Fixesrust-lang/rust-clippy#16061.
Extend `never_loop` to also lint iterator reduction methods (e.g.
`for_each`, `try_for_each`, `fold`, `try_fold`, `reduce`, `all`, `any`)
when the closure’s body diverges (return type `!`). Add a UI test
`never_loop_iterator_reduction` to cover these cases.
Testing:
- TESTNAME=never_loop_iterator_reduction cargo uitest
changelog: [`never_loop`]: lint diverging iterator reduction closures
like `for_each` and `fold`
Fix `ref_as_ptr` false positives for temporary values and
let/static/const initializers.
Fixesrust-lang/rust-clippy#16220
changelog: [`ref_as_ptr`]: Only lint on non-temporary expressions)
changelog: Fix FP of [`if_then_some_else_none`] when the `then` block
contains `await` codes.
That is because `bool:then` doesn't work with await code.
Closes: rust-lang/rust-clippy#16176