Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #795 from mcarton/deprecated
Deprecates 4 lints
- Loading branch information
Showing
11 changed files
with
115 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
macro_rules! declare_deprecated_lint { | ||
(pub $name: ident, $_reason: expr) => { | ||
declare_lint!(pub $name, Allow, "deprecated lint") | ||
} | ||
} | ||
|
||
/// **What it does:** Nothing. This lint has been deprecated. | ||
/// | ||
/// **Deprecation reason:** This used to check for `Vec::as_slice`, which was unstable with good | ||
/// stable alternatives. `Vec::as_slice` has now been stabilized. | ||
declare_deprecated_lint! { | ||
pub UNSTABLE_AS_SLICE, | ||
"`Vec::as_slice` has been stabilized in 1.7" | ||
} | ||
|
||
|
||
/// **What it does:** Nothing. This lint has been deprecated. | ||
/// | ||
/// **Deprecation reason:** This used to check for `Vec::as_mut_slice`, which was unstable with good | ||
/// stable alternatives. `Vec::as_mut_slice` has now been stabilized. | ||
declare_deprecated_lint! { | ||
pub UNSTABLE_AS_MUT_SLICE, | ||
"`Vec::as_mut_slice` has been stabilized in 1.7" | ||
} | ||
|
||
/// **What it does:** Nothing. This lint has been deprecated. | ||
/// | ||
/// **Deprecation reason:** This used to check for `.to_string()` method calls on values | ||
/// of type `&str`. This is not unidiomatic and with specialization coming, `to_string` could be | ||
/// specialized to be as efficient as `to_owned`. | ||
declare_deprecated_lint! { | ||
pub STR_TO_STRING, | ||
"using `str::to_string` is common even today and specialization will likely happen soon" | ||
} | ||
|
||
/// **What it does:** Nothing. This lint has been deprecated. | ||
/// | ||
/// **Deprecation reason:** This used to check for `.to_string()` method calls on values | ||
/// of type `String`. This is not unidiomatic and with specialization coming, `to_string` could be | ||
/// specialized to be as efficient as `clone`. | ||
declare_deprecated_lint! { | ||
pub STRING_TO_STRING, | ||
"using `string::to_string` is common even today and specialization will likely happen soon" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![feature(plugin)] | ||
#![plugin(clippy)] | ||
|
||
#[warn(str_to_string)] | ||
//~^WARNING: warning: lint str_to_string has been removed: using `str::to_string` | ||
#[warn(string_to_string)] | ||
//~^WARNING: warning: lint string_to_string has been removed: using `string::to_string` | ||
#[warn(unstable_as_slice)] | ||
//~^WARNING: warning: lint unstable_as_slice has been removed: `Vec::as_slice` has been stabilized | ||
#[warn(unstable_as_mut_slice)] | ||
//~^WARNING: warning: lint unstable_as_mut_slice has been removed: `Vec::as_mut_slice` has been stabilized | ||
fn main() {} |
Oops, something went wrong.