A-lintE-mediumL-correctnessgood first issue
Repository metrics
- Stars
- (10,406 stars)
- PR merge metrics
- (Avg merge 19d 22h) (113 merged PRs in 30d)
Description
Implementing Copy for iterators makes footguns, and the standard library settled not to do so for now.
let mut it = /* a Copy + Iterator */;
for x in it { if cond { break; } } // `it` copied here (forgot to `&mut it`)
let x = it.next(); // `it` is in the initial state
Clippy should have a lint that warns if "use of the original iterator after copied" is detected.