rustc_lint_defs::builtin

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.