Skip to content

Commit 7e35a74

Browse files
committed
Deprecate REPLACE_CONSTS lint
1 parent 70b93aa commit 7e35a74

File tree

5 files changed

+14
-116
lines changed

5 files changed

+14
-116
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

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

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

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

clippy_lints/src/deprecated_lints.rs

+8
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,11 @@ declare_deprecated_lint! {
147147
pub UNUSED_LABEL,
148148
"this lint has been uplifted to rustc and is now called `unused_labels`"
149149
}
150+
151+
declare_deprecated_lint! {
152+
/// **What it does:** Nothing. This lint has been deprecated.
153+
///
154+
/// **Deprecation reason:** Associated-constants are now preferred.
155+
pub REPLACE_CONSTS,
156+
"associated-constants `MIN`/`MAX` of integers are prefer to `{min,max}_value()` and module constants"
157+
}

clippy_lints/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ pub mod redundant_pub_crate;
291291
pub mod redundant_static_lifetimes;
292292
pub mod reference;
293293
pub mod regex;
294-
pub mod replace_consts;
295294
pub mod returns;
296295
pub mod serde_api;
297296
pub mod shadow;
@@ -470,6 +469,10 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
470469
"clippy::unused_label",
471470
"this lint has been uplifted to rustc and is now called `unused_labels`",
472471
);
472+
store.register_removed(
473+
"clippy::replace_consts",
474+
"associated-constants `MIN`/`MAX` of integers are prefer to `{min,max}_value()` and module constants",
475+
);
473476
// end deprecated lints, do not remove this comment, it’s used in `update_lints`
474477

475478
// begin register lints, do not remove this comment, it’s used in `update_lints`
@@ -755,7 +758,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
755758
&regex::INVALID_REGEX,
756759
&regex::REGEX_MACRO,
757760
&regex::TRIVIAL_REGEX,
758-
&replace_consts::REPLACE_CONSTS,
759761
&returns::LET_AND_RETURN,
760762
&returns::NEEDLESS_RETURN,
761763
&returns::UNUSED_UNIT,
@@ -953,7 +955,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
953955
store.register_late_pass(|| box identity_conversion::IdentityConversion::default());
954956
store.register_late_pass(|| box types::ImplicitHasher);
955957
store.register_late_pass(|| box fallible_impl_from::FallibleImplFrom);
956-
store.register_late_pass(|| box replace_consts::ReplaceConsts);
957958
store.register_late_pass(|| box types::UnitArg);
958959
store.register_late_pass(|| box double_comparison::DoubleComparisons);
959960
store.register_late_pass(|| box question_mark::QuestionMark);
@@ -1110,7 +1111,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11101111
LintId::of(&needless_pass_by_value::NEEDLESS_PASS_BY_VALUE),
11111112
LintId::of(&non_expressive_names::SIMILAR_NAMES),
11121113
LintId::of(&ranges::RANGE_PLUS_ONE),
1113-
LintId::of(&replace_consts::REPLACE_CONSTS),
11141114
LintId::of(&shadow::SHADOW_UNRELATED),
11151115
LintId::of(&strings::STRING_ADD_ASSIGN),
11161116
LintId::of(&trait_bounds::TYPE_REPETITION_IN_BOUNDS),

clippy_lints/src/replace_consts.rs

-103
This file was deleted.

src/lintlist/mod.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub use lint::Lint;
66
pub use lint::LINT_LEVELS;
77

88
// begin lint list, do not remove this comment, it’s used in `update_lints`
9-
pub const ALL_LINTS: [Lint; 362] = [
9+
pub const ALL_LINTS: [Lint; 361] = [
1010
Lint {
1111
name: "absurd_extreme_comparisons",
1212
group: "correctness",
@@ -1792,13 +1792,6 @@ pub const ALL_LINTS: [Lint; 362] = [
17921792
deprecation: None,
17931793
module: "regex",
17941794
},
1795-
Lint {
1796-
name: "replace_consts",
1797-
group: "pedantic",
1798-
desc: "Lint usages of standard library `const`s that could be replaced by `const fn`s",
1799-
deprecation: None,
1800-
module: "replace_consts",
1801-
},
18021795
Lint {
18031796
name: "rest_pat_in_fully_bound_structs",
18041797
group: "restriction",

0 commit comments

Comments
 (0)