Skip to content

Commit 63487dd

Browse files
committed
clippy::redundant_locals is not a correctness lint
Even its documentation says so. According to the documentation, it might either be a "suspicious" or a "perf" lint.
1 parent 0e2505b commit 63487dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/redundant_locals.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ declare_clippy_lint! {
1717
/// Checks for redundant redefinitions of local bindings.
1818
///
1919
/// ### Why is this bad?
20-
/// Redundant redefinitions of local bindings do not change behavior and are likely to be unintended.
20+
/// Redundant redefinitions of local bindings do not change behavior other than variable's lifetimes and are likely to be unintended.
2121
///
22-
/// Note that although these bindings do not affect your code's meaning, they _may_ affect `rustc`'s stack allocation.
22+
/// These rebindings can be intentional to shorten the lifetimes of variables because they affect when the `Drop` implementation is called. Other than that, they do not affect your code's meaning but they _may_ affect `rustc`'s stack allocation.
2323
///
2424
/// ### Example
2525
/// ```no_run
@@ -41,7 +41,7 @@ declare_clippy_lint! {
4141
/// ```
4242
#[clippy::version = "1.73.0"]
4343
pub REDUNDANT_LOCALS,
44-
correctness,
44+
suspicious,
4545
"redundant redefinition of a local binding"
4646
}
4747
declare_lint_pass!(RedundantLocals => [REDUNDANT_LOCALS]);

0 commit comments

Comments
 (0)