Remove clippy::author attribute from trailing_zeroes test
This commit is contained in:
parent
b67dfb4896
commit
fff6b0e17c
@ -1,10 +1,8 @@
|
||||
#![feature(stmt_expr_attributes)]
|
||||
#![allow(unused_parens)]
|
||||
|
||||
fn main() {
|
||||
let x: i32 = 42;
|
||||
let _ = #[clippy::author]
|
||||
(x & 0b1111 == 0); // suggest trailing_zeros
|
||||
let _ = (x & 0b1111 == 0); // suggest trailing_zeros
|
||||
let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
|
||||
let _ = x & 0b1_1010 == 0; // do not lint
|
||||
let _ = x & 1 == 0; // do not lint
|
||||
|
@ -1,13 +1,13 @@
|
||||
error: bit mask could be simplified with a call to `trailing_zeros`
|
||||
--> $DIR/trailing_zeros.rs:7:5
|
||||
--> $DIR/trailing_zeros.rs:5:13
|
||||
|
|
||||
LL | (x & 0b1111 == 0); // suggest trailing_zeros
|
||||
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 4`
|
||||
LL | let _ = (x & 0b1111 == 0); // suggest trailing_zeros
|
||||
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 4`
|
||||
|
|
||||
= note: `-D clippy::verbose-bit-mask` implied by `-D warnings`
|
||||
|
||||
error: bit mask could be simplified with a call to `trailing_zeros`
|
||||
--> $DIR/trailing_zeros.rs:8:13
|
||||
--> $DIR/trailing_zeros.rs:6:13
|
||||
|
|
||||
LL | let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
|
||||
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 5`
|
||||
|
@ -1,15 +0,0 @@
|
||||
if_chain! {
|
||||
if let ExprKind::Binary(ref op, ref left, ref right) = expr.kind;
|
||||
if BinOpKind::Eq == op.node;
|
||||
if let ExprKind::Binary(ref op1, ref left1, ref right1) = left.kind;
|
||||
if BinOpKind::BitAnd == op1.node;
|
||||
if let ExprKind::Path(ref path) = left1.kind;
|
||||
if match_qpath(path, &["x"]);
|
||||
if let ExprKind::Lit(ref lit) = right1.kind;
|
||||
if let LitKind::Int(15, _) = lit.node;
|
||||
if let ExprKind::Lit(ref lit1) = right.kind;
|
||||
if let LitKind::Int(0, _) = lit1.node;
|
||||
then {
|
||||
// report your lint here
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user