]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/deprecated_lints.rs
Auto merge of #3946 - rchaser53:issue-3920, r=flip1995
[rust.git] / clippy_lints / src / deprecated_lints.rs
index 0067629bbd0fc2952be851fc67ec1f17c78b2672..62cef778917b984083d1c69f7bda6ca6db06a770 100644 (file)
@@ -1,13 +1,3 @@
-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
 macro_rules! declare_deprecated_lint {
     (pub $name: ident, $_reason: expr) => {
         declare_lint!(pub $name, Allow, "deprecated lint")
@@ -16,7 +6,7 @@ macro_rules! declare_deprecated_lint {
 
 /// **What it does:** Nothing. This lint has been deprecated.
 ///
-/// **Deprecation reason:** This used to check for `assert!(a == b)` and recommend 
+/// **Deprecation reason:** This used to check for `assert!(a == b)` and recommend
 /// replacement with `assert_eq!(a, b)`, but this is no longer needed after RFC 2011.
 declare_deprecated_lint! {
     pub SHOULD_ASSERT_EQ,
@@ -100,5 +90,26 @@ macro_rules! declare_deprecated_lint {
 /// counterparts, so this lint may suggest a change in behavior or the code may not compile.
 declare_deprecated_lint! {
     pub ASSIGN_OPS,
-    "using compound assignment operators (e.g. `+=`) is harmless"
+    "using compound assignment operators (e.g., `+=`) is harmless"
+}
+
+/// **What it does:** Nothing. This lint has been deprecated.
+///
+/// **Deprecation reason:** The original rule will only lint for `if let`. After
+/// making it support to lint `match`, naming as `if let` is not suitable for it.
+/// So, this lint is deprecated.
+declare_deprecated_lint! {
+    pub IF_LET_REDUNDANT_PATTERN_MATCHING,
+    "this lint has been changed to redundant_pattern_matching"
+}
+
+/// **What it does:** Nothing. This lint has been deprecated.
+///
+/// **Deprecation reason:** This lint used to suggest replacing `let mut vec =
+/// Vec::with_capacity(n); vec.set_len(n);` with `let vec = vec![0; n];`. The
+/// replacement has very different performance characteristics so the lint is
+/// deprecated.
+declare_deprecated_lint! {
+    pub UNSAFE_VECTOR_INITIALIZATION,
+    "the replacement suggested by this lint had substantially different behavior"
 }