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/util | |
| parent | d6fb338d01864e3801cab9f76d608f204d11fc27 (diff) | |
| download | rust-ccd8498afbb371939b7decdbee712f726ccbded3.tar.gz rust-ccd8498afbb371939b7decdbee712f726ccbded3.zip | |
syntax: fix fallout from using ptr::P.
Diffstat (limited to 'src/libsyntax/util')
| -rw-r--r-- | src/libsyntax/util/parser_testing.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index 7b96cf3c60d..bc5b9bc6c18 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -9,6 +9,7 @@ // except according to those terms. use ast; +use ast::P; use parse::{new_parse_sess}; use parse::{ParseSess,string_to_filemap,filemap_to_tts}; use parse::{new_parser_from_source_str}; @@ -48,21 +49,21 @@ pub fn string_to_crate (source_str : String) -> ast::Crate { } /// Parse a string, return an expr -pub fn string_to_expr (source_str : String) -> Gc<ast::Expr> { +pub fn string_to_expr (source_str : String) -> P<ast::Expr> { with_error_checking_parse(source_str, |p| { p.parse_expr() }) } /// Parse a string, return an item -pub fn string_to_item (source_str : String) -> Option<Gc<ast::Item>> { +pub fn string_to_item (source_str : String) -> Option<P<ast::Item>> { with_error_checking_parse(source_str, |p| { p.parse_item(Vec::new()) }) } /// Parse a string, return a stmt -pub fn string_to_stmt(source_str : String) -> Gc<ast::Stmt> { +pub fn string_to_stmt(source_str : String) -> P<ast::Stmt> { with_error_checking_parse(source_str, |p| { p.parse_stmt(Vec::new()) }) @@ -70,7 +71,7 @@ pub fn string_to_stmt(source_str : String) -> Gc<ast::Stmt> { /// Parse a string, return a pat. Uses "irrefutable"... which doesn't /// (currently) affect parsing. -pub fn string_to_pat(source_str: String) -> Gc<ast::Pat> { +pub fn string_to_pat(source_str: String) -> P<ast::Pat> { string_to_parser(&new_parse_sess(), source_str).parse_pat() } |
