about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-07-03 16:41:26 +0000
committerbors <bors@rust-lang.org>2020-07-03 16:41:26 +0000
commit57cdf2dc16e1833008ae5b120cb2c045d267dda8 (patch)
treefc61082fd0ccea7433ff7a7e43d07853d08629de /src
parentfff8e7291381327f5106120b98d7f9585a493cad (diff)
parentc0fd452840c7cc53b3396268f62ed2a0a2e8fef7 (diff)
downloadrust-57cdf2dc16e1833008ae5b120cb2c045d267dda8.tar.gz
rust-57cdf2dc16e1833008ae5b120cb2c045d267dda8.zip
Auto merge of #4841 - phaylon:pattern-type-mismatch, r=flip1995
Added restriction lint: pattern-type-mismatch

changelog: Added a new restriction lint `pattern-type-mismatch`. This lint is especially helpful for beginners learning about the magic behind pattern matching. (This explanation might be worth to include in the next changelog.)
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 a2998d74130..6402efc2521 100644
--- a/src/lintlist/mod.rs
+++ b/src/lintlist/mod.rs
@@ -1698,6 +1698,13 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
         module: "path_buf_push_overwrite",
     },
     Lint {
+        name: "pattern_type_mismatch",
+        group: "restriction",
+        desc: "type of pattern does not match the expression type",
+        deprecation: None,
+        module: "pattern_type_mismatch",
+    },
+    Lint {
         name: "possible_missing_comma",
         group: "correctness",
         desc: "possible missing comma in array",