]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/issue_2356.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / issue_2356.rs
CommitLineData
923072b8 1// run-rustfix
f20569fa 2#![deny(clippy::while_let_on_iterator)]
923072b8 3#![allow(unused_mut)]
2b03887a 4#![allow(clippy::uninlined_format_args)]
f20569fa
XL
5
6use std::iter::Iterator;
7
8struct Foo;
9
10impl 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
24fn main() {
25 Foo::foo1(vec![].into_iter());
26 Foo::foo2(vec![].into_iter());
27}