auto merge of #14414 : richo/rust/features/nerf_unused_string_fns, r=alexcrichton

This should block on #14323
This commit is contained in:
bors 2014-05-27 17:46:48 -07:00
commit 911cc9c352
387 changed files with 3016 additions and 3012 deletions

View file

@ -70,7 +70,7 @@ pub fn expand_expr(e: @ast::Expr, fld: &mut MacroExpander) -> @ast::Expr {
fld.cx.bt_push(ExpnInfo {
call_site: e.span,
callee: NameAndSpan {
name: extnamestr.get().to_strbuf(),
name: extnamestr.get().to_string(),
format: MacroBang,
span: exp_span,
},
@ -298,7 +298,7 @@ pub fn expand_item(it: @ast::Item, fld: &mut MacroExpander)
fld.cx.bt_push(ExpnInfo {
call_site: attr.span,
callee: NameAndSpan {
name: mname.get().to_strbuf(),
name: mname.get().to_string(),
format: MacroAttribute,
span: None
}
@ -370,7 +370,7 @@ fn expand_item_modifiers(mut it: @ast::Item, fld: &mut MacroExpander)
fld.cx.bt_push(ExpnInfo {
call_site: attr.span,
callee: NameAndSpan {
name: mname.get().to_strbuf(),
name: mname.get().to_string(),
format: MacroAttribute,
span: None,
}
@ -430,7 +430,7 @@ pub fn expand_item_mac(it: @ast::Item, fld: &mut MacroExpander)
fld.cx.bt_push(ExpnInfo {
call_site: it.span,
callee: NameAndSpan {
name: extnamestr.get().to_strbuf(),
name: extnamestr.get().to_string(),
format: MacroBang,
span: span
}
@ -449,7 +449,7 @@ pub fn expand_item_mac(it: @ast::Item, fld: &mut MacroExpander)
fld.cx.bt_push(ExpnInfo {
call_site: it.span,
callee: NameAndSpan {
name: extnamestr.get().to_strbuf(),
name: extnamestr.get().to_string(),
format: MacroBang,
span: span
}
@ -530,7 +530,7 @@ fn load_extern_macros(krate: &ast::ViewItem, fld: &mut MacroExpander) {
_ => unreachable!()
};
let name = format!("<{} macros>", token::get_ident(crate_name));
let name = name.to_strbuf();
let name = name.to_string();
for source in macros.iter() {
let item = parse::parse_item_from_source_str(name.clone(),
@ -620,7 +620,7 @@ pub fn expand_stmt(s: &Stmt, fld: &mut MacroExpander) -> SmallVector<@Stmt> {
fld.cx.bt_push(ExpnInfo {
call_site: s.span,
callee: NameAndSpan {
name: extnamestr.get().to_strbuf(),
name: extnamestr.get().to_string(),
format: MacroBang,
span: exp_span,
}
@ -1067,10 +1067,10 @@ mod test {
#[should_fail]
#[test] fn macros_cant_escape_fns_test () {
let src = "fn bogus() {macro_rules! z (() => (3+4))}\
fn inty() -> int { z!() }".to_strbuf();
fn inty() -> int { z!() }".to_string();
let sess = parse::new_parse_sess();
let crate_ast = parse::parse_crate_from_source_str(
"<test>".to_strbuf(),
"<test>".to_string(),
src,
Vec::new(), &sess);
// should fail:
@ -1087,10 +1087,10 @@ mod test {
#[should_fail]
#[test] fn macros_cant_escape_mods_test () {
let src = "mod foo {macro_rules! z (() => (3+4))}\
fn inty() -> int { z!() }".to_strbuf();
fn inty() -> int { z!() }".to_string();
let sess = parse::new_parse_sess();
let crate_ast = parse::parse_crate_from_source_str(
"<test>".to_strbuf(),
"<test>".to_string(),
src,
Vec::new(), &sess);
// should fail:
@ -1106,10 +1106,10 @@ mod test {
// macro_escape modules shouldn't cause macros to leave scope
#[test] fn macros_can_escape_flattened_mods_test () {
let src = "#[macro_escape] mod foo {macro_rules! z (() => (3+4))}\
fn inty() -> int { z!() }".to_strbuf();
fn inty() -> int { z!() }".to_string();
let sess = parse::new_parse_sess();
let crate_ast = parse::parse_crate_from_source_str(
"<test>".to_strbuf(),
"<test>".to_string(),
src,
Vec::new(), &sess);
// should fail:
@ -1173,7 +1173,7 @@ mod test {
#[test] fn macro_tokens_should_match(){
expand_crate_str(
"macro_rules! m((a)=>(13)) fn main(){m!(a);}".to_strbuf());
"macro_rules! m((a)=>(13)) fn main(){m!(a);}".to_string());
}
// renaming tests expand a crate and then check that the bindings match
@ -1231,7 +1231,7 @@ mod test {
let (teststr, bound_connections, bound_ident_check) = match *t {
(ref str,ref conns, bic) => (str.to_owned(), conns.clone(), bic)
};
let cr = expand_crate_str(teststr.to_strbuf());
let cr = expand_crate_str(teststr.to_string());
// find the bindings:
let mut name_finder = new_name_finder(Vec::new());
visit::walk_crate(&mut name_finder,&cr,());
@ -1306,7 +1306,7 @@ mod test {
let crate_str = "macro_rules! fmt_wrap(($b:expr)=>($b.to_str()))
macro_rules! foo_module (() => (mod generated { fn a() { let xx = 147; fmt_wrap!(xx);}}))
foo_module!()
".to_strbuf();
".to_string();
let cr = expand_crate_str(crate_str);
// find the xx binding
let mut name_finder = new_name_finder(Vec::new());
@ -1353,7 +1353,7 @@ foo_module!()
#[test]
fn pat_idents(){
let pat = string_to_pat(
"(a,Foo{x:c @ (b,9),y:Bar(4,d)})".to_strbuf());
"(a,Foo{x:c @ (b,9),y:Bar(4,d)})".to_string());
let mut pat_idents = new_name_finder(Vec::new());
pat_idents.visit_pat(pat, ());
assert_eq!(pat_idents.ident_accumulator,