diff --git a/tests/ui/author/blocks.rs b/tests/ui/author/blocks.rs index c7d173388..cabb0cc8c 100644 --- a/tests/ui/author/blocks.rs +++ b/tests/ui/author/blocks.rs @@ -1,4 +1,5 @@ #![feature(stmt_expr_attributes)] +#![allow(redundant_semicolon)] #[rustfmt::skip] fn main() { diff --git a/tests/ui/author/blocks.stderr b/tests/ui/author/blocks.stderr index a54a1422d..176666334 100644 --- a/tests/ui/author/blocks.stderr +++ b/tests/ui/author/blocks.stderr @@ -1,10 +1,16 @@ error: statement with no effect - --> $DIR/blocks.rs:14:5 + --> $DIR/blocks.rs:8:9 | -LL | -x; - | ^^^ +LL | ;;;; + | ^^^^ | = note: `-D clippy::no-effect` implied by `-D warnings` -error: aborting due to previous error +error: statement with no effect + --> $DIR/blocks.rs:15:5 + | +LL | -x; + | ^^^ + +error: aborting due to 2 previous errors diff --git a/tests/ui/author/blocks.stdout b/tests/ui/author/blocks.stdout index 0128b3b02..f7b78503b 100644 --- a/tests/ui/author/blocks.stdout +++ b/tests/ui/author/blocks.stdout @@ -1,7 +1,10 @@ if_chain! { if let ExprKind::Block(ref block) = expr.node; if let Some(trailing_expr) = &block.expr; - if block.stmts.len() == 0; + if block.stmts.len() == 1; + if let StmtKind::Semi(ref e, _) = block.stmts[0].node + if let ExprKind::Tup(ref elements) = e.node; + if elements.len() == 0; then { // report your lint here } diff --git a/tests/ui/swap.rs b/tests/ui/swap.rs index 77cfc16ff..9db8dcbf7 100644 --- a/tests/ui/swap.rs +++ b/tests/ui/swap.rs @@ -1,5 +1,5 @@ #![warn(clippy::all)] -#![allow(clippy::blacklisted_name, unused_assignments)] +#![allow(clippy::blacklisted_name, clippy::no_effect, redundant_semicolon, unused_assignments)] struct Foo(u32);