]> git.lizzy.rs Git - rust.git/blob - clippy_lints/src/deprecated_lints.rs
deprecate extend_from_slice lint
[rust.git] / clippy_lints / src / deprecated_lints.rs
1 macro_rules! declare_deprecated_lint {
2     (pub $name: ident, $_reason: expr) => {
3         declare_lint!(pub $name, Allow, "deprecated lint")
4     }
5 }
6
7
8 /// **What it does:** Nothing. This lint has been deprecated.
9 ///
10 /// **Deprecation reason:** This used to check for `Vec::extend`, which was slower than
11 /// `Vec::extend_from_slice`. Thanks to specialization, this is no longer true.
12 declare_deprecated_lint! {
13     pub EXTEND_FROM_SLICE,
14     "`.extend_from_slice(_)` is a faster way to extend a Vec by a slice"
15 }
16
17
18 /// **What it does:** Nothing. This lint has been deprecated.
19 ///
20 /// **Deprecation reason:** This used to check for `Vec::as_slice`, which was unstable with good
21 /// stable alternatives. `Vec::as_slice` has now been stabilized.
22 declare_deprecated_lint! {
23     pub UNSTABLE_AS_SLICE,
24     "`Vec::as_slice` has been stabilized in 1.7"
25 }
26
27
28 /// **What it does:** Nothing. This lint has been deprecated.
29 ///
30 /// **Deprecation reason:** This used to check for `Vec::as_mut_slice`, which was unstable with good
31 /// stable alternatives. `Vec::as_mut_slice` has now been stabilized.
32 declare_deprecated_lint! {
33     pub UNSTABLE_AS_MUT_SLICE,
34     "`Vec::as_mut_slice` has been stabilized in 1.7"
35 }
36
37 /// **What it does:** Nothing. This lint has been deprecated.
38 ///
39 /// **Deprecation reason:** This used to check for `.to_string()` method calls on values
40 /// of type `&str`. This is not unidiomatic and with specialization coming, `to_string` could be
41 /// specialized to be as efficient as `to_owned`.
42 declare_deprecated_lint! {
43     pub STR_TO_STRING,
44     "using `str::to_string` is common even today and specialization will likely happen soon"
45 }
46
47 /// **What it does:** Nothing. This lint has been deprecated.
48 ///
49 /// **Deprecation reason:** This used to check for `.to_string()` method calls on values
50 /// of type `String`. This is not unidiomatic and with specialization coming, `to_string` could be
51 /// specialized to be as efficient as `clone`.
52 declare_deprecated_lint! {
53     pub STRING_TO_STRING,
54     "using `string::to_string` is common even today and specialization will likely happen soon"
55 }