UNCONDITIONAL_RECURSION in rustc_lint_defs::builtin - Rust
Description: The `unconditional_recursion` lint detects functions that cannot return without calling themselves.

Skip to main content

## UNCONDITIONAL_RECURSION

# Static UNCONDITIONAL_RECURSION

Source

    pub static UNCONDITIONAL_RECURSION: &Lint

Expand description

The `unconditional_recursion` lint detects functions that cannot return without calling themselves.

#### §Example

    fn foo() {
        foo();
    }

{{produces}}

#### §Explanation

It is usually a mistake to have a recursive call that does not have some condition to cause it to terminate. If you really intend to have an infinite loop, using a `loop` expression is recommended.