Merge pull request #571 from nrc/semi

Don't strip semi-colons from expressions with non-void type since it …
This commit is contained in:
Marcus Klaas de Vries 2015-11-10 08:43:29 +01:00
commit b6120b39ab
3 changed files with 4 additions and 8 deletions

View File

@ -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,
}
}

View File

@ -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!");
}
};
}

View File

@ -228,7 +228,7 @@ fn issue383() {
match resolution.last_private {
LastImport{..} => false,
_ => true,
}
};
}
fn issue507() {