Skip to content

Commit

Permalink
Downgrade range_plus_one to pedantic
Browse files Browse the repository at this point in the history
  • Loading branch information
llogiq committed Jan 18, 2020
1 parent 6bd0580 commit cb1092c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&needless_continue::NEEDLESS_CONTINUE),
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),
Expand Down Expand Up @@ -1277,7 +1278,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&ptr_offset_with_cast::PTR_OFFSET_WITH_CAST),
LintId::of(&question_mark::QUESTION_MARK),
LintId::of(&ranges::RANGE_MINUS_ONE),
LintId::of(&ranges::RANGE_PLUS_ONE),
LintId::of(&ranges::RANGE_ZIP_WITH_LEN),
LintId::of(&redundant_clone::REDUNDANT_CLONE),
LintId::of(&redundant_field_names::REDUNDANT_FIELD_NAMES),
Expand Down Expand Up @@ -1495,7 +1495,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&precedence::PRECEDENCE),
LintId::of(&ptr_offset_with_cast::PTR_OFFSET_WITH_CAST),
LintId::of(&ranges::RANGE_MINUS_ONE),
LintId::of(&ranges::RANGE_PLUS_ONE),
LintId::of(&ranges::RANGE_ZIP_WITH_LEN),
LintId::of(&reference::DEREF_ADDROF),
LintId::of(&reference::REF_IN_DEREF),
Expand Down
6 changes: 5 additions & 1 deletion clippy_lints/src/ranges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ declare_clippy_lint! {
/// and ends with a closing one.
/// I.e., `let _ = (f()+1)..(f()+1)` results in `let _ = ((f()+1)..=f())`.
///
/// Also in many cases, inclusive ranges are still slower to run than
/// exclusive ranges, because they essentially add an extra branch that
/// LLVM may fail to hoist out of the loop.
///
/// **Example:**
/// ```rust,ignore
/// for x..(y+1) { .. }
Expand All @@ -54,7 +58,7 @@ declare_clippy_lint! {
/// for x..=y { .. }
/// ```
pub RANGE_PLUS_ONE,
complexity,
pedantic,
"`x..(y+1)` reads better as `x..=y`"
}

Expand Down
2 changes: 1 addition & 1 deletion src/lintlist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ pub const ALL_LINTS: [Lint; 347] = [
},
Lint {
name: "range_plus_one",
group: "complexity",
group: "pedantic",
desc: "`x..(y+1)` reads better as `x..=y`",
deprecation: None,
module: "ranges",
Expand Down

0 comments on commit cb1092c

Please sign in to comment.