WHILE_TRUE in rustc_lint::builtin - Rust
Description: The `while_true` lint detects `while true { }`.

Skip to main content

## WHILE_TRUE

# Static WHILE_TRUE

Source

    static WHILE_TRUE: &Lint

Expand description

The `while_true` lint detects `while true { }`.

#### §Example

    while true {

    }

{{produces}}

#### §Explanation

`while true` should be replaced with `loop`. A `loop` expression is the preferred way to write an infinite loop because it more directly expresses the intent of the loop.