Skip to content

Commit f96c47e

Browse files
authored
Merge pull request rust-lang#6036 from giraffate/update_verbose_bit_mask_to_pedantic
Downgrade `verbose_bit_mask` to pedantic
2 parents 21c3518 + 9ff7e5d commit f96c47e

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

clippy_lints/src/bit_mask.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ declare_clippy_lint! {
9090
/// if x & 0b1111 == 0 { }
9191
/// ```
9292
pub VERBOSE_BIT_MASK,
93-
style,
93+
pedantic,
9494
"expressions where a bit mask is less readable than the corresponding method call"
9595
}
9696

clippy_lints/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11571157
store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
11581158
LintId::of(&attrs::INLINE_ALWAYS),
11591159
LintId::of(&await_holding_lock::AWAIT_HOLDING_LOCK),
1160+
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
11601161
LintId::of(&checked_conversions::CHECKED_CONVERSIONS),
11611162
LintId::of(&copies::MATCH_SAME_ARMS),
11621163
LintId::of(&copies::SAME_FUNCTIONS_IN_IF_CONDITION),
@@ -1254,7 +1255,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
12541255
LintId::of(&attrs::USELESS_ATTRIBUTE),
12551256
LintId::of(&bit_mask::BAD_BIT_MASK),
12561257
LintId::of(&bit_mask::INEFFECTIVE_BIT_MASK),
1257-
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
12581258
LintId::of(&blacklisted_name::BLACKLISTED_NAME),
12591259
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
12601260
LintId::of(&booleans::LOGIC_BUG),
@@ -1512,7 +1512,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
15121512
LintId::of(&assign_ops::ASSIGN_OP_PATTERN),
15131513
LintId::of(&attrs::BLANKET_CLIPPY_RESTRICTION_LINTS),
15141514
LintId::of(&attrs::UNKNOWN_CLIPPY_LINTS),
1515-
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
15161515
LintId::of(&blacklisted_name::BLACKLISTED_NAME),
15171516
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
15181517
LintId::of(&collapsible_if::COLLAPSIBLE_IF),

src/lintlist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2637,7 +2637,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
26372637
},
26382638
Lint {
26392639
name: "verbose_bit_mask",
2640-
group: "style",
2640+
group: "pedantic",
26412641
desc: "expressions where a bit mask is less readable than the corresponding method call",
26422642
deprecation: None,
26432643
module: "bit_mask",

tests/ui/trailing_zeros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![allow(unused_parens)]
2+
#![warn(clippy::verbose_bit_mask)]
23

34
fn main() {
45
let x: i32 = 42;

tests/ui/trailing_zeros.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: bit mask could be simplified with a call to `trailing_zeros`
2-
--> $DIR/trailing_zeros.rs:5:13
2+
--> $DIR/trailing_zeros.rs:6:13
33
|
44
LL | let _ = (x & 0b1111 == 0); // suggest trailing_zeros
55
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 4`
66
|
77
= note: `-D clippy::verbose-bit-mask` implied by `-D warnings`
88

99
error: bit mask could be simplified with a call to `trailing_zeros`
10-
--> $DIR/trailing_zeros.rs:6:13
10+
--> $DIR/trailing_zeros.rs:7:13
1111
|
1212
LL | let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
1313
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 5`

0 commit comments

Comments
 (0)