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