]> git.lizzy.rs Git - rust.git/blob - src/docs/maybe_infinite_iter.txt
Add iter_kv_map lint
[rust.git] / src / docs / maybe_infinite_iter.txt
1 ### What it does
2 Checks for iteration that may be infinite.
3
4 ### Why is this bad?
5 While there may be places where this is acceptable
6 (e.g., in event streams), in most cases this is simply an error.
7
8 ### Known problems
9 The code may have a condition to stop iteration, but
10 this lint is not clever enough to analyze it.
11
12 ### Example
13 ```
14 let infinite_iter = 0..;
15 [0..].iter().zip(infinite_iter.take_while(|x| *x > 5));
16 ```