Files
rust/tests/ui/issue_2356.fixed
T
Ada Alakbarova e9ede27a5d test: remove extraneous #[allow(clippy::uninlined_format_args)]
These were probably added automatically to avoid code churn. I'd like to
get rid of them bit by bit, so here's the first bit
2025-09-30 18:08:37 +02:00

27 lines
515 B
Rust

#![deny(clippy::while_let_on_iterator)]
#![allow(unused_mut)]
use std::iter::Iterator;
struct Foo;
impl Foo {
fn foo1<I: Iterator<Item = usize>>(mut it: I) {
while let Some(_) = it.next() {
println!("{:?}", it.size_hint());
}
}
fn foo2<I: Iterator<Item = usize>>(mut it: I) {
for e in it {
//~^ while_let_on_iterator
println!("{e:?}");
}
}
}
fn main() {
Foo::foo1(vec![].into_iter());
Foo::foo2(vec![].into_iter());
}