about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTim Nielens <tim.nielens@gmail.com>2020-05-23 00:07:09 +0200
committerTim Nielens <tim.nielens@gmail.com>2020-05-30 17:52:10 +0200
commit5faab874f9f8655c8f284944b5acdede5c088af4 (patch)
tree198d06384b65b3e619d856a5674fc938615f095f /src
parent7ea7cd165ad6705603852771bf82cc2fd6560db5 (diff)
downloadrust-5faab874f9f8655c8f284944b5acdede5c088af4.tar.gz
rust-5faab874f9f8655c8f284944b5acdede5c088af4.zip
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",