Skip to content

Commit

Permalink
Deprecate REPLACE_CONSTS lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Mar 29, 2020
1 parent 70b93aa commit d055b7d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 466 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.

[There are 362 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
[There are 361 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)

We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you:

Expand Down
8 changes: 8 additions & 0 deletions clippy_lints/src/deprecated_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,11 @@ declare_deprecated_lint! {
pub UNUSED_LABEL,
"this lint has been uplifted to rustc and is now called `unused_labels`"
}

declare_deprecated_lint! {
/// **What it does:** Nothing. This lint has been deprecated.
///
/// **Deprecation reason:** Associated-constants are now preferred.
pub REPLACE_CONSTS,
"associated-constants `MIN`/`MAX` of integers are prefer to `{min,max}_value()` and module constants"
}
8 changes: 4 additions & 4 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ pub mod redundant_pub_crate;
pub mod redundant_static_lifetimes;
pub mod reference;
pub mod regex;
pub mod replace_consts;
pub mod returns;
pub mod serde_api;
pub mod shadow;
Expand Down Expand Up @@ -470,6 +469,10 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
"clippy::unused_label",
"this lint has been uplifted to rustc and is now called `unused_labels`",
);
store.register_removed(
"clippy::replace_consts",
"associated-constants `MIN`/`MAX` of integers are prefer to `{min,max}_value()` and module constants",
);
// end deprecated lints, do not remove this comment, it’s used in `update_lints`

// begin register lints, do not remove this comment, it’s used in `update_lints`
Expand Down Expand Up @@ -755,7 +758,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
&regex::INVALID_REGEX,
&regex::REGEX_MACRO,
&regex::TRIVIAL_REGEX,
&replace_consts::REPLACE_CONSTS,
&returns::LET_AND_RETURN,
&returns::NEEDLESS_RETURN,
&returns::UNUSED_UNIT,
Expand Down Expand Up @@ -953,7 +955,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
store.register_late_pass(|| box identity_conversion::IdentityConversion::default());
store.register_late_pass(|| box types::ImplicitHasher);
store.register_late_pass(|| box fallible_impl_from::FallibleImplFrom);
store.register_late_pass(|| box replace_consts::ReplaceConsts);
store.register_late_pass(|| box types::UnitArg);
store.register_late_pass(|| box double_comparison::DoubleComparisons);
store.register_late_pass(|| box question_mark::QuestionMark);
Expand Down Expand Up @@ -1110,7 +1111,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&needless_pass_by_value::NEEDLESS_PASS_BY_VALUE),
LintId::of(&non_expressive_names::SIMILAR_NAMES),
LintId::of(&ranges::RANGE_PLUS_ONE),
LintId::of(&replace_consts::REPLACE_CONSTS),
LintId::of(&shadow::SHADOW_UNRELATED),
LintId::of(&strings::STRING_ADD_ASSIGN),
LintId::of(&trait_bounds::TYPE_REPETITION_IN_BOUNDS),
Expand Down
103 changes: 0 additions & 103 deletions clippy_lints/src/replace_consts.rs

This file was deleted.

9 changes: 1 addition & 8 deletions src/lintlist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub use lint::Lint;
pub use lint::LINT_LEVELS;

// begin lint list, do not remove this comment, it’s used in `update_lints`
pub const ALL_LINTS: [Lint; 362] = [
pub const ALL_LINTS: [Lint; 361] = [
Lint {
name: "absurd_extreme_comparisons",
group: "correctness",
Expand Down Expand Up @@ -1792,13 +1792,6 @@ pub const ALL_LINTS: [Lint; 362] = [
deprecation: None,
module: "regex",
},
Lint {
name: "replace_consts",
group: "pedantic",
desc: "Lint usages of standard library `const`s that could be replaced by `const fn`s",
deprecation: None,
module: "replace_consts",
},
Lint {
name: "rest_pat_in_fully_bound_structs",
group: "restriction",
Expand Down
99 changes: 0 additions & 99 deletions tests/ui/replace_consts.fixed

This file was deleted.

99 changes: 0 additions & 99 deletions tests/ui/replace_consts.rs

This file was deleted.

Loading

0 comments on commit d055b7d

Please sign in to comment.