rust/tests/ui/crashes/ice-11230.fixed
Matthias Krüger 8275f42350 add more test coverage for #11230
Closes #11230

changelog: nonew.
2024-12-31 17:02:29 +01:00

16 lines
365 B
Rust

// Test for https://github.com/rust-lang/rust-clippy/issues/11230
#![warn(clippy::explicit_iter_loop)]
#![warn(clippy::needless_collect)]
// explicit_iter_loop
fn main() {
const A: &[for<'a> fn(&'a ())] = &[];
for v in A {}
}
// needless_collect
trait Helper<'a>: Iterator<Item = fn()> {}
fn x(w: &mut dyn for<'a> Helper<'a>) {
w.next().is_none();
}