mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
d36794f5ec
Fixes rust-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`