about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCatherine Flores <catherine.3.flores@gmail.com>2025-01-07 00:50:22 +0000
committerGitHub <noreply@github.com>2025-01-07 00:50:22 +0000
commit98b9a263bc91b16eedfa2616089cbd172cebb919 (patch)
treee4e7b36797630bfd2514e91a43ad140d64fc424f
parent0e2505ba8f34303f7f049af20f58b0ddc80bb404 (diff)
parent63487dde5318bdddbf2fb2d24d725acc99833e88 (diff)
downloadrust-98b9a263bc91b16eedfa2616089cbd172cebb919.tar.gz
rust-98b9a263bc91b16eedfa2616089cbd172cebb919.zip
`clippy::redundant_locals` is not a correctness lint (#13747)
Even its documentation says so. According to the documentation, it might
either be a "suspicious" or a "perf" lint.

changelog: [`redundant_locals`]: Reclassify as "suspicious" lint.
-rw-r--r--clippy_lints/src/redundant_locals.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/redundant_locals.rs b/clippy_lints/src/redundant_locals.rs
index 4f46ca3c715..658d93e634c 100644
--- a/clippy_lints/src/redundant_locals.rs
+++ b/clippy_lints/src/redundant_locals.rs
@@ -17,9 +17,9 @@ declare_clippy_lint! {
     /// Checks for redundant redefinitions of local bindings.
     ///
     /// ### Why is this bad?
-    /// Redundant redefinitions of local bindings do not change behavior and are likely to be unintended.
+    /// Redundant redefinitions of local bindings do not change behavior other than variable's lifetimes and are likely to be unintended.
     ///
-    /// Note that although these bindings do not affect your code's meaning, they _may_ affect `rustc`'s stack allocation.
+    /// 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.
     ///
     /// ### Example
     /// ```no_run
@@ -41,7 +41,7 @@ declare_clippy_lint! {
     /// ```
     #[clippy::version = "1.73.0"]
     pub REDUNDANT_LOCALS,
-    correctness,
+    suspicious,
     "redundant redefinition of a local binding"
 }
 declare_lint_pass!(RedundantLocals => [REDUNDANT_LOCALS]);