mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Rustup to rust-lang/rust#62984
Lint redundant_semicolon was added to rustc
This commit is contained in:
parent
e1d573c242
commit
87fa2d90f5
4 changed files with 16 additions and 6 deletions
|
@ -1,4 +1,5 @@
|
|||
#![feature(stmt_expr_attributes)]
|
||||
#![allow(redundant_semicolon)]
|
||||
|
||||
#[rustfmt::skip]
|
||||
fn main() {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue