From ccd8498afbb371939b7decdbee712f726ccbded3 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Sat, 13 Sep 2014 19:06:01 +0300 Subject: syntax: fix fallout from using ptr::P. --- src/libsyntax/util/parser_testing.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/libsyntax/util') 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 { +pub fn string_to_expr (source_str : String) -> P { 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> { +pub fn string_to_item (source_str : String) -> Option> { 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 { +pub fn string_to_stmt(source_str : String) -> P { 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 { /// Parse a string, return a pat. Uses "irrefutable"... which doesn't /// (currently) affect parsing. -pub fn string_to_pat(source_str: String) -> Gc { +pub fn string_to_pat(source_str: String) -> P { string_to_parser(&new_parse_sess(), source_str).parse_pat() } -- cgit 1.4.1-3-g733a5