]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/issue_2356.rs
Rollup merge of #102345 - chenyukang:fix-102182-impl-trait, r=estebank
[rust.git] / src / tools / clippy / tests / ui / issue_2356.rs
1 // run-rustfix
2 #![deny(clippy::while_let_on_iterator)]
3 #![allow(unused_mut)]
4 #![allow(clippy::uninlined_format_args)]
5
6 use std::iter::Iterator;
7
8 struct Foo;
9
10 impl Foo {
11     fn foo1<I: Iterator<Item = usize>>(mut it: I) {
12         while let Some(_) = it.next() {
13             println!("{:?}", it.size_hint());
14         }
15     }
16
17     fn foo2<I: Iterator<Item = usize>>(mut it: I) {
18         while let Some(e) = it.next() {
19             println!("{:?}", e);
20         }
21     }
22 }
23
24 fn main() {
25     Foo::foo1(vec![].into_iter());
26     Foo::foo2(vec![].into_iter());
27 }