about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-04-27 06:02:05 +0000
committerbors <bors@rust-lang.org>2020-04-27 06:02:05 +0000
commitd13ffbe3feeb4dfef16c85ff39155137b7be1278 (patch)
tree5316da9945e96a79cf68b6ca1fa0975b43ccb63f /src
parent5d8a3e8724f587c6b2a888087a3643ead5534fde (diff)
parentb574941dcbf34b529b5c1eb1fa75ca6b1496b666 (diff)
downloadrust-d13ffbe3feeb4dfef16c85ff39155137b7be1278.tar.gz
rust-d13ffbe3feeb4dfef16c85ff39155137b7be1278.zip
Auto merge of #5522 - CrazyRoka:match_vec_item, r=phansch
New  lint `match_vec_item`

Added new lint to warn a match on index item which can panic. It's always better to use `get(..)` instead.
Closes #5500
changelog: New lint `match_on_vec_items`
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 c6c388ee9f0..72675c25175 100644
--- a/src/lintlist/mod.rs
+++ b/src/lintlist/mod.rs
@@ -1145,6 +1145,13 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
         module: "matches",
     },
     Lint {
+        name: "match_on_vec_items",
+        group: "correctness",
+        desc: "matching on vector elements can panic",
+        deprecation: None,
+        module: "match_on_vec_items",
+    },
+    Lint {
         name: "match_overlapping_arm",
         group: "style",
         desc: "a `match` with overlapping arms",