rustc_lint_defs::builtin

Static UNUSED_ASSIGNMENTS

source
pub static UNUSED_ASSIGNMENTS: &Lint
Expand description

The unused_assignments lint detects assignments that will never be read.

§Example

let mut x = 5;
x = 6;

{{produces}}

§Explanation

Unused assignments may signal a mistake or unfinished code. If the variable is never used after being assigned, then the assignment can be removed. Variables with an underscore prefix such as _x will not trigger this lint.