1 macro_rules! declare_deprecated_lint {
2 (pub $name: ident, $_reason: expr) => {
3 declare_lint!(pub $name, Allow, "deprecated lint")
7 /// **What it does:** Nothing. This lint has been deprecated.
9 /// **Deprecation reason:** This used to check for `assert!(a == b)` and recommend
10 /// replacement with `assert_eq!(a, b)`, but this is no longer needed after RFC 2011.
11 declare_deprecated_lint! {
13 "`assert!()` will be more flexible with RFC 2011"
16 /// **What it does:** Nothing. This lint has been deprecated.
18 /// **Deprecation reason:** This used to check for `Vec::extend`, which was slower than
19 /// `Vec::extend_from_slice`. Thanks to specialization, this is no longer true.
20 declare_deprecated_lint! {
21 pub EXTEND_FROM_SLICE,
22 "`.extend_from_slice(_)` is a faster way to extend a Vec by a slice"
25 /// **What it does:** Nothing. This lint has been deprecated.
27 /// **Deprecation reason:** `Range::step_by(0)` used to be linted since it's
28 /// an infinite iterator, which is better expressed by `iter::repeat`,
29 /// but the method has been removed for `Iterator::step_by` which panics
31 declare_deprecated_lint! {
32 pub RANGE_STEP_BY_ZERO,
33 "`iterator.step_by(0)` panics nowadays"
36 /// **What it does:** Nothing. This lint has been deprecated.
38 /// **Deprecation reason:** This used to check for `Vec::as_slice`, which was unstable with good
39 /// stable alternatives. `Vec::as_slice` has now been stabilized.
40 declare_deprecated_lint! {
41 pub UNSTABLE_AS_SLICE,
42 "`Vec::as_slice` has been stabilized in 1.7"
46 /// **What it does:** Nothing. This lint has been deprecated.
48 /// **Deprecation reason:** This used to check for `Vec::as_mut_slice`, which was unstable with good
49 /// stable alternatives. `Vec::as_mut_slice` has now been stabilized.
50 declare_deprecated_lint! {
51 pub UNSTABLE_AS_MUT_SLICE,
52 "`Vec::as_mut_slice` has been stabilized in 1.7"
55 /// **What it does:** Nothing. This lint has been deprecated.
57 /// **Deprecation reason:** This used to check for `.to_string()` method calls on values
58 /// of type `&str`. This is not unidiomatic and with specialization coming, `to_string` could be
59 /// specialized to be as efficient as `to_owned`.
60 declare_deprecated_lint! {
62 "using `str::to_string` is common even today and specialization will likely happen soon"
65 /// **What it does:** Nothing. This lint has been deprecated.
67 /// **Deprecation reason:** This used to check for `.to_string()` method calls on values
68 /// of type `String`. This is not unidiomatic and with specialization coming, `to_string` could be
69 /// specialized to be as efficient as `clone`.
70 declare_deprecated_lint! {
72 "using `string::to_string` is common even today and specialization will likely happen soon"
75 /// **What it does:** Nothing. This lint has been deprecated.
77 /// **Deprecation reason:** This lint should never have applied to non-pointer types, as transmuting
78 /// between non-pointer types of differing alignment is well-defined behavior (it's semantically
79 /// equivalent to a memcpy). This lint has thus been refactored into two separate lints:
80 /// cast_ptr_alignment and transmute_ptr_to_ptr.
81 declare_deprecated_lint! {
82 pub MISALIGNED_TRANSMUTE,
83 "this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr"
86 /// **What it does:** Nothing. This lint has been deprecated.
88 /// **Deprecation reason:** This lint is too subjective, not having a good reason for being in clippy.
89 /// Additionally, compound assignment operators may be overloaded separately from their non-assigning
90 /// counterparts, so this lint may suggest a change in behavior or the code may not compile.
91 declare_deprecated_lint! {
93 "using compound assignment operators (e.g. `+=`) is harmless"