about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/trailing_zeros.rs4
-rw-r--r--tests/ui/trailing_zeros.stderr8
-rw-r--r--tests/ui/trailing_zeros.stdout15
3 files changed, 5 insertions, 22 deletions
diff --git a/tests/ui/trailing_zeros.rs b/tests/ui/trailing_zeros.rs
index 4ee5ecffb87..1cef8c2cfc9 100644
--- a/tests/ui/trailing_zeros.rs
+++ b/tests/ui/trailing_zeros.rs
@@ -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
diff --git a/tests/ui/trailing_zeros.stderr b/tests/ui/trailing_zeros.stderr
index 61289b24471..320d9cc3f64 100644
--- a/tests/ui/trailing_zeros.stderr
+++ b/tests/ui/trailing_zeros.stderr
@@ -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`
diff --git a/tests/ui/trailing_zeros.stdout b/tests/ui/trailing_zeros.stdout
deleted file mode 100644
index eccad22c47f..00000000000
--- a/tests/ui/trailing_zeros.stdout
+++ /dev/null
@@ -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
-    }
-}