Move some range lints to complexity

Recategorize `range_plus_one` and `range_minus_one` to `complexity`.
This moves `range_plus_one` out of the nursery as the inclusive range
syntax is now stable. Both are moved to `complexity` as it is more
consistent with other lints such as `int_plus_one`.
This commit is contained in:
Michael Wright
2018-08-26 10:57:04 +02:00
parent 296b79bdb8
commit cc87dc7539
2 changed files with 5 additions and 4 deletions

View File

@@ -635,6 +635,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
question_mark::QUESTION_MARK, question_mark::QUESTION_MARK,
ranges::ITERATOR_STEP_BY_ZERO, ranges::ITERATOR_STEP_BY_ZERO,
ranges::RANGE_MINUS_ONE, ranges::RANGE_MINUS_ONE,
ranges::RANGE_PLUS_ONE,
ranges::RANGE_ZIP_WITH_LEN, ranges::RANGE_ZIP_WITH_LEN,
redundant_field_names::REDUNDANT_FIELD_NAMES, redundant_field_names::REDUNDANT_FIELD_NAMES,
reference::DEREF_ADDROF, reference::DEREF_ADDROF,
@@ -756,7 +757,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
ptr::CMP_NULL, ptr::CMP_NULL,
ptr::PTR_ARG, ptr::PTR_ARG,
question_mark::QUESTION_MARK, question_mark::QUESTION_MARK,
ranges::RANGE_MINUS_ONE,
redundant_field_names::REDUNDANT_FIELD_NAMES, redundant_field_names::REDUNDANT_FIELD_NAMES,
regex::REGEX_MACRO, regex::REGEX_MACRO,
regex::TRIVIAL_REGEX, regex::TRIVIAL_REGEX,
@@ -816,6 +816,8 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL, overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
partialeq_ne_impl::PARTIALEQ_NE_IMPL, partialeq_ne_impl::PARTIALEQ_NE_IMPL,
precedence::PRECEDENCE, precedence::PRECEDENCE,
ranges::RANGE_MINUS_ONE,
ranges::RANGE_PLUS_ONE,
ranges::RANGE_ZIP_WITH_LEN, ranges::RANGE_ZIP_WITH_LEN,
reference::DEREF_ADDROF, reference::DEREF_ADDROF,
reference::REF_IN_DEREF, reference::REF_IN_DEREF,
@@ -921,7 +923,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
fallible_impl_from::FALLIBLE_IMPL_FROM, fallible_impl_from::FALLIBLE_IMPL_FROM,
mutex_atomic::MUTEX_INTEGER, mutex_atomic::MUTEX_INTEGER,
needless_borrow::NEEDLESS_BORROW, needless_borrow::NEEDLESS_BORROW,
ranges::RANGE_PLUS_ONE,
unwrap::PANICKING_UNWRAP, unwrap::PANICKING_UNWRAP,
unwrap::UNNECESSARY_UNWRAP, unwrap::UNNECESSARY_UNWRAP,
]); ]);

View File

@@ -57,7 +57,7 @@ declare_clippy_lint! {
/// ``` /// ```
declare_clippy_lint! { declare_clippy_lint! {
pub RANGE_PLUS_ONE, pub RANGE_PLUS_ONE,
nursery, complexity,
"`x..(y+1)` reads better as `x..=y`" "`x..(y+1)` reads better as `x..=y`"
} }
@@ -75,7 +75,7 @@ declare_clippy_lint! {
/// ``` /// ```
declare_clippy_lint! { declare_clippy_lint! {
pub RANGE_MINUS_ONE, pub RANGE_MINUS_ONE,
style, complexity,
"`x..=(y-1)` reads better as `x..y`" "`x..=(y-1)` reads better as `x..y`"
} }