]> git.lizzy.rs Git - rust.git/blob - src/deprecated_lints.rs
Merge pull request #681 from oli-obk/split
[rust.git] / 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 /// **What it does:** Nothing. This lint has been deprecated.
8 ///
9 /// **Deprecation reason:** This used to check for `Vec::as_slice`, which was unstable with good
10 /// stable alternatives. `Vec::as_slice` has now been stabilized.
11 declare_deprecated_lint! {
12     pub UNSTABLE_AS_SLICE,
13     "`Vec::as_slice` has been stabilized in 1.7"
14 }
15
16
17 /// **What it does:** Nothing. This lint has been deprecated.
18 ///
19 /// **Deprecation reason:** This used to check for `Vec::as_mut_slice`, which was unstable with good
20 /// stable alternatives. `Vec::as_mut_slice` has now been stabilized.
21 declare_deprecated_lint! {
22     pub UNSTABLE_AS_MUT_SLICE,
23     "`Vec::as_mut_slice` has been stabilized in 1.7"
24 }
25
26 /// **What it does:** Nothing. This lint has been deprecated.
27 ///
28 /// **Deprecation reason:** This used to check for `.to_string()` method calls on values
29 /// of type `&str`. This is not unidiomatic and with specialization coming, `to_string` could be
30 /// specialized to be as efficient as `to_owned`.
31 declare_deprecated_lint! {
32     pub STR_TO_STRING,
33     "using `str::to_string` is common even today and specialization will likely happen soon"
34 }
35
36 /// **What it does:** Nothing. This lint has been deprecated.
37 ///
38 /// **Deprecation reason:** This used to check for `.to_string()` method calls on values
39 /// of type `String`. This is not unidiomatic and with specialization coming, `to_string` could be
40 /// specialized to be as efficient as `clone`.
41 declare_deprecated_lint! {
42     pub STRING_TO_STRING,
43     "using `string::to_string` is common even today and specialization will likely happen soon"
44 }