diff options
| author | Marcus Klaas de Vries <mail@marcusklaas.nl> | 2015-11-10 08:43:29 +0100 |
|---|---|---|
| committer | Marcus Klaas de Vries <mail@marcusklaas.nl> | 2015-11-10 08:43:29 +0100 |
| commit | b6120b39ab91d94de46d9430b1552fdfef861f33 (patch) | |
| tree | 5e25ac832705a0c142939a2115a9f33f06fe7a41 | |
| parent | 5346daf541c37714b36a8d84c054e002f5fdbf8d (diff) | |
| parent | 3dc0b804f1a50871d2a5187492ba92421727799c (diff) | |
Merge pull request #571 from nrc/semi
Don't strip semi-colons from expressions with non-void type since it …
| -rw-r--r-- | src/visitor.rs | 6 | ||||
| -rw-r--r-- | tests/target/expr.rs | 4 | ||||
| -rw-r--r-- | tests/target/match.rs | 2 |
3 files changed, 4 insertions, 8 deletions
diff --git a/src/visitor.rs b/src/visitor.rs index 534b2c877fd..6114dfff077 100644 --- a/src/visitor.rs +++ b/src/visitor.rs @@ -507,12 +507,8 @@ fn semicolon_for_stmt(stmt: &ast::Stmt) -> bool { match expr.node { ast::Expr_::ExprWhile(..) | ast::Expr_::ExprWhileLet(..) | - ast::Expr_::ExprIf(..) | - ast::Expr_::ExprIfLet(..) | - ast::Expr_::ExprBlock(..) | ast::Expr_::ExprLoop(..) | - ast::Expr_::ExprForLoop(..) | - ast::Expr_::ExprMatch(..) => false, + ast::Expr_::ExprForLoop(..) => false, _ => true, } } diff --git a/tests/target/expr.rs b/tests/target/expr.rs index bfd6161e4d8..d39309258b0 100644 --- a/tests/target/expr.rs +++ b/tests/target/expr.rs @@ -41,7 +41,7 @@ fn foo() -> bool { result } else { 4 - } + }; if let Some(x) = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa { // Nothing @@ -254,5 +254,5 @@ fn repeats() { fn blocks() { if 1 + 1 == 2 { println!("yay arithmetix!"); - } + }; } diff --git a/tests/target/match.rs b/tests/target/match.rs index 4df098eb4d1..1d6842d358a 100644 --- a/tests/target/match.rs +++ b/tests/target/match.rs @@ -228,7 +228,7 @@ fn issue383() { match resolution.last_private { LastImport{..} => false, _ => true, - } + }; } fn issue507() { |
