rustc: Obsolete the @ syntax entirely
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
This commit is contained in:
@@ -15,6 +15,8 @@ use parse::{new_parser_from_source_str};
|
||||
use parse::parser::Parser;
|
||||
use parse::token;
|
||||
|
||||
use std::gc::Gc;
|
||||
|
||||
// map a string to tts, using a made-up filename:
|
||||
pub fn string_to_tts(source_str: String) -> Vec<ast::TokenTree> {
|
||||
let ps = new_parse_sess();
|
||||
@@ -46,21 +48,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) -> @ast::Expr {
|
||||
pub fn string_to_expr (source_str : String) -> Gc<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<@ast::Item> {
|
||||
pub fn string_to_item (source_str : String) -> Option<Gc<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) -> @ast::Stmt {
|
||||
pub fn string_to_stmt(source_str : String) -> Gc<ast::Stmt> {
|
||||
with_error_checking_parse(source_str, |p| {
|
||||
p.parse_stmt(Vec::new())
|
||||
})
|
||||
@@ -68,7 +70,7 @@ pub fn string_to_stmt(source_str : String) -> @ast::Stmt {
|
||||
|
||||
// parse a string, return a pat. Uses "irrefutable"... which doesn't
|
||||
// (currently) affect parsing.
|
||||
pub fn string_to_pat(source_str: String) -> @ast::Pat {
|
||||
pub fn string_to_pat(source_str: String) -> Gc<ast::Pat> {
|
||||
string_to_parser(&new_parse_sess(), source_str).parse_pat()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user