mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 00:53:31 +00:00
Downgrade verbose_bit_mask
to pedantic
This commit is contained in:
parent
21c351867a
commit
9ff7e5d984
5 changed files with 6 additions and 6 deletions
|
@ -90,7 +90,7 @@ declare_clippy_lint! {
|
||||||
/// if x & 0b1111 == 0 { }
|
/// if x & 0b1111 == 0 { }
|
||||||
/// ```
|
/// ```
|
||||||
pub VERBOSE_BIT_MASK,
|
pub VERBOSE_BIT_MASK,
|
||||||
style,
|
pedantic,
|
||||||
"expressions where a bit mask is less readable than the corresponding method call"
|
"expressions where a bit mask is less readable than the corresponding method call"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1157,6 +1157,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||||
store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
|
store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
|
||||||
LintId::of(&attrs::INLINE_ALWAYS),
|
LintId::of(&attrs::INLINE_ALWAYS),
|
||||||
LintId::of(&await_holding_lock::AWAIT_HOLDING_LOCK),
|
LintId::of(&await_holding_lock::AWAIT_HOLDING_LOCK),
|
||||||
|
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
|
||||||
LintId::of(&checked_conversions::CHECKED_CONVERSIONS),
|
LintId::of(&checked_conversions::CHECKED_CONVERSIONS),
|
||||||
LintId::of(&copies::MATCH_SAME_ARMS),
|
LintId::of(&copies::MATCH_SAME_ARMS),
|
||||||
LintId::of(&copies::SAME_FUNCTIONS_IN_IF_CONDITION),
|
LintId::of(&copies::SAME_FUNCTIONS_IN_IF_CONDITION),
|
||||||
|
@ -1254,7 +1255,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||||
LintId::of(&attrs::USELESS_ATTRIBUTE),
|
LintId::of(&attrs::USELESS_ATTRIBUTE),
|
||||||
LintId::of(&bit_mask::BAD_BIT_MASK),
|
LintId::of(&bit_mask::BAD_BIT_MASK),
|
||||||
LintId::of(&bit_mask::INEFFECTIVE_BIT_MASK),
|
LintId::of(&bit_mask::INEFFECTIVE_BIT_MASK),
|
||||||
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
|
|
||||||
LintId::of(&blacklisted_name::BLACKLISTED_NAME),
|
LintId::of(&blacklisted_name::BLACKLISTED_NAME),
|
||||||
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
|
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
|
||||||
LintId::of(&booleans::LOGIC_BUG),
|
LintId::of(&booleans::LOGIC_BUG),
|
||||||
|
@ -1512,7 +1512,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||||
LintId::of(&assign_ops::ASSIGN_OP_PATTERN),
|
LintId::of(&assign_ops::ASSIGN_OP_PATTERN),
|
||||||
LintId::of(&attrs::BLANKET_CLIPPY_RESTRICTION_LINTS),
|
LintId::of(&attrs::BLANKET_CLIPPY_RESTRICTION_LINTS),
|
||||||
LintId::of(&attrs::UNKNOWN_CLIPPY_LINTS),
|
LintId::of(&attrs::UNKNOWN_CLIPPY_LINTS),
|
||||||
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
|
|
||||||
LintId::of(&blacklisted_name::BLACKLISTED_NAME),
|
LintId::of(&blacklisted_name::BLACKLISTED_NAME),
|
||||||
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
|
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
|
||||||
LintId::of(&collapsible_if::COLLAPSIBLE_IF),
|
LintId::of(&collapsible_if::COLLAPSIBLE_IF),
|
||||||
|
|
|
@ -2637,7 +2637,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
|
||||||
},
|
},
|
||||||
Lint {
|
Lint {
|
||||||
name: "verbose_bit_mask",
|
name: "verbose_bit_mask",
|
||||||
group: "style",
|
group: "pedantic",
|
||||||
desc: "expressions where a bit mask is less readable than the corresponding method call",
|
desc: "expressions where a bit mask is less readable than the corresponding method call",
|
||||||
deprecation: None,
|
deprecation: None,
|
||||||
module: "bit_mask",
|
module: "bit_mask",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#![allow(unused_parens)]
|
#![allow(unused_parens)]
|
||||||
|
#![warn(clippy::verbose_bit_mask)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: i32 = 42;
|
let x: i32 = 42;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error: bit mask could be simplified with a call to `trailing_zeros`
|
error: bit mask could be simplified with a call to `trailing_zeros`
|
||||||
--> $DIR/trailing_zeros.rs:5:13
|
--> $DIR/trailing_zeros.rs:6:13
|
||||||
|
|
|
|
||||||
LL | let _ = (x & 0b1111 == 0); // suggest trailing_zeros
|
LL | let _ = (x & 0b1111 == 0); // suggest trailing_zeros
|
||||||
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 4`
|
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 4`
|
||||||
|
@ -7,7 +7,7 @@ LL | let _ = (x & 0b1111 == 0); // suggest trailing_zeros
|
||||||
= note: `-D clippy::verbose-bit-mask` implied by `-D warnings`
|
= note: `-D clippy::verbose-bit-mask` implied by `-D warnings`
|
||||||
|
|
||||||
error: bit mask could be simplified with a call to `trailing_zeros`
|
error: bit mask could be simplified with a call to `trailing_zeros`
|
||||||
--> $DIR/trailing_zeros.rs:6:13
|
--> $DIR/trailing_zeros.rs:7:13
|
||||||
|
|
|
|
||||||
LL | let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
|
LL | let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
|
||||||
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 5`
|
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 5`
|
||||||
|
|
Loading…
Reference in a new issue