]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/issue_2356.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / issue_2356.rs
CommitLineData
f20569fa
XL
1#![deny(clippy::while_let_on_iterator)]
2
3use std::iter::Iterator;
4
5struct Foo;
6
7impl Foo {
8 fn foo1<I: Iterator<Item = usize>>(mut it: I) {
9 while let Some(_) = it.next() {
10 println!("{:?}", it.size_hint());
11 }
12 }
13
14 fn foo2<I: Iterator<Item = usize>>(mut it: I) {
15 while let Some(e) = it.next() {
16 println!("{:?}", e);
17 }
18 }
19}
20
21fn main() {
22 Foo::foo1(vec![].into_iter());
23 Foo::foo2(vec![].into_iter());
24}