UNCONDITIONAL_PANIC in rustc_lint::builtin - Rust
Description: The `unconditional_panic` lint detects an operation that will cause a panic at runtime.

Skip to main content

## UNCONDITIONAL_PANIC

# Static UNCONDITIONAL_PANIC

Source

    pub static UNCONDITIONAL_PANIC: &'static Lint

Expand description

The `unconditional_panic` lint detects an operation that will cause a panic at runtime.

#### §Example

ⓘ

    let x = 1 / 0;

{{produces}}

#### §Explanation

This lint detects code that is very likely incorrect because it will always panic, such as division by zero and out-of-bounds array accesses. Consider adjusting your code if this is a bug, or using the `panic!` or `unreachable!` macro instead in case the panic is intended.