diff options
| author | flip1995 <hello@philkrones.com> | 2019-08-15 10:13:52 +0200 |
|---|---|---|
| committer | flip1995 <hello@philkrones.com> | 2019-08-15 10:14:06 +0200 |
| commit | 87fa2d90f5601966caefe9bc67679b61b5361f78 (patch) | |
| tree | b5f63f0e573b5c9d759c4250c06bdb07839d8aa2 | |
| parent | e1d573c2420a58ce4425db0a07b16f0a772bbe99 (diff) | |
| download | rust-87fa2d90f5601966caefe9bc67679b61b5361f78.tar.gz rust-87fa2d90f5601966caefe9bc67679b61b5361f78.zip | |
Rustup to rust-lang/rust#62984
Lint redundant_semicolon was added to rustc
| -rw-r--r-- | tests/ui/author/blocks.rs | 1 | ||||
| -rw-r--r-- | tests/ui/author/blocks.stderr | 14 | ||||
| -rw-r--r-- | tests/ui/author/blocks.stdout | 5 | ||||
| -rw-r--r-- | tests/ui/swap.rs | 2 |
4 files changed, 16 insertions, 6 deletions
diff --git a/tests/ui/author/blocks.rs b/tests/ui/author/blocks.rs index c7d173388a5..cabb0cc8c32 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 a54a1422d8b..1766663344c 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 0128b3b0289..f7b78503b1d 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 77cfc16ff6e..9db8dcbf75e 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); |
