RS.CLIPPY.INFINITE_ITER

Infinite iteration

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: infinite_iter. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for iteration that is guaranteed to 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.

Example

use std::iter;

iter::repeat(1_u8).collect::<Vec<_>>();