]> 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 e51d7cc6d3838f7a9db13945695f62ec47f6eeb4..62cef778917b984083d1c69f7bda6ca6db06a770 100644 (file)
@@ -6,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,
@@ -71,3 +71,45 @@ macro_rules! declare_deprecated_lint {
     pub STRING_TO_STRING,
     "using `string::to_string` is common even today and specialization will likely happen soon"
 }
+
+/// **What it does:** Nothing. This lint has been deprecated.
+///
+/// **Deprecation reason:** This lint should never have applied to non-pointer types, as transmuting
+/// between non-pointer types of differing alignment is well-defined behavior (it's semantically
+/// equivalent to a memcpy). This lint has thus been refactored into two separate lints:
+/// cast_ptr_alignment and transmute_ptr_to_ptr.
+declare_deprecated_lint! {
+    pub MISALIGNED_TRANSMUTE,
+    "this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr"
+}
+
+/// **What it does:** Nothing. This lint has been deprecated.
+///
+/// **Deprecation reason:** This lint is too subjective, not having a good reason for being in clippy.
+/// Additionally, compound assignment operators may be overloaded separately from their non-assigning
+/// 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"
+}
+
+/// **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"
+}