about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2020-05-31 14:57:32 +0200
committerGitHub <noreply@github.com>2020-05-31 14:57:32 +0200
commit0fff522071c35f3af405bf64179dea41d7bcb1e1 (patch)
tree62d1e734b795c6739f75f2ed2c7406cbaee84fe6 /src
parent5713574991d0a542a237d3442d6e020c92a300e1 (diff)
parent5faab874f9f8655c8f284944b5acdede5c088af4 (diff)
downloadrust-0fff522071c35f3af405bf64179dea41d7bcb1e1.tar.gz
rust-0fff522071c35f3af405bf64179dea41d7bcb1e1.zip
Rollup merge of #5637 - montrivo:feature/vec_resize_to_zero, r=yaahc,flip1995
new lint: vec_resize_to_zero

implements #5444

changelog: new lint vec_resize_to_zero
Diffstat (limited to 'src')
-rw-r--r--src/lintlist/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs
index f63301c7db0..1e94ca00c14 100644
--- a/src/lintlist/mod.rs
+++ b/src/lintlist/mod.rs
@@ -2461,6 +2461,13 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
         module: "types",
     },
     Lint {
+        name: "vec_resize_to_zero",
+        group: "correctness",
+        desc: "emptying a vector with `resize(0, an_int)` instead of `clear()` is probably an argument inversion mistake",
+        deprecation: None,
+        module: "vec_resize_to_zero",
+    },
+    Lint {
         name: "verbose_bit_mask",
         group: "style",
         desc: "expressions where a bit mask is less readable than the corresponding method call",