diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2014-09-13 19:06:01 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2014-09-14 03:39:36 +0300 |
| commit | ccd8498afbb371939b7decdbee712f726ccbded3 (patch) | |
| tree | 8939c9dba98ee7a2f624e82c3c72dcf33576d350 /src/libsyntax/parse/classify.rs | |
| parent | d6fb338d01864e3801cab9f76d608f204d11fc27 (diff) | |
| download | rust-ccd8498afbb371939b7decdbee712f726ccbded3.tar.gz rust-ccd8498afbb371939b7decdbee712f726ccbded3.zip | |
syntax: fix fallout from using ptr::P.
Diffstat (limited to 'src/libsyntax/parse/classify.rs')
| -rw-r--r-- | src/libsyntax/parse/classify.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libsyntax/parse/classify.rs b/src/libsyntax/parse/classify.rs index 516f22cdf4d..cdd221aca7c 100644 --- a/src/libsyntax/parse/classify.rs +++ b/src/libsyntax/parse/classify.rs @@ -13,7 +13,6 @@ // Predicates on exprs and stmts that the pretty-printer and parser use use ast; -use std::gc::Gc; /// Does this expression require a semicolon to be treated /// as a statement? The negation of this: 'can this expression @@ -22,7 +21,7 @@ use std::gc::Gc; /// if true {...} else {...} /// |x| 5 /// isn't parsed as (if true {...} else {...} | x) | 5 -pub fn expr_requires_semi_to_be_stmt(e: Gc<ast::Expr>) -> bool { +pub fn expr_requires_semi_to_be_stmt(e: &ast::Expr) -> bool { match e.node { ast::ExprIf(..) | ast::ExprMatch(..) @@ -34,25 +33,25 @@ pub fn expr_requires_semi_to_be_stmt(e: Gc<ast::Expr>) -> bool { } } -pub fn expr_is_simple_block(e: Gc<ast::Expr>) -> bool { +pub fn expr_is_simple_block(e: &ast::Expr) -> bool { match e.node { - ast::ExprBlock(block) => block.rules == ast::DefaultBlock, - _ => false + ast::ExprBlock(ref block) => block.rules == ast::DefaultBlock, + _ => false } } /// this statement requires a semicolon after it. /// note that in one case (stmt_semi), we've already /// seen the semicolon, and thus don't need another. -pub fn stmt_ends_with_semi(stmt: &ast::Stmt) -> bool { - return match stmt.node { - ast::StmtDecl(d, _) => { +pub fn stmt_ends_with_semi(stmt: &ast::Stmt_) -> bool { + match *stmt { + ast::StmtDecl(ref d, _) => { match d.node { ast::DeclLocal(_) => true, ast::DeclItem(_) => false } } - ast::StmtExpr(e, _) => { expr_requires_semi_to_be_stmt(e) } + ast::StmtExpr(ref e, _) => { expr_requires_semi_to_be_stmt(&**e) } ast::StmtSemi(..) => { false } ast::StmtMac(..) => { false } } |
