A-lintE-mediumL-correctnessgood first issue
仓库指标
- Star
- (10,406 star)
- PR 合并指标
- (平均合并 19天 22小时) (30 天内合并 113 个 PR)
描述
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.