16 lines
365 B
Rust
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();
|
|
}
|