Skip to content

Commit c1423cc

Browse files
pcwaltonhuonw
authored andcommitted
---
yaml --- r: 107860 b: refs/heads/dist-snap c: b890237 h: refs/heads/master v: v3
1 parent 0a88e4d commit c1423cc

File tree

8 files changed

+53
-51
lines changed

8 files changed

+53
-51
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 52eeed2f73652014cde448b5dc969c7299a1fbcb
9+
refs/heads/dist-snap: b890237e798030ce337933b14f777a1c3810d1ea
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<'a> fold::Folder for TestHarnessGenerator<'a> {
134134
if !cx.sess.building_library.get() {
135135
@ast::Item {
136136
attrs: item.attrs.iter().filter_map(|attr| {
137-
if attr.name().equiv(&("main")) {
137+
if !attr.name().equiv(&("main")) {
138138
Some(*attr)
139139
} else {
140140
None

branches/dist-snap/src/libsyntax/codemap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ mod test {
468468
#[test]
469469
fn t1 () {
470470
let cm = CodeMap::new();
471-
let fm = cm.new_filemap(@"blork.rs",@"first line.\nsecond line");
471+
let fm = cm.new_filemap(~"blork.rs",~"first line.\nsecond line");
472472
fm.next_line(BytePos(0));
473473
assert_eq!(&fm.get_line(0),&~"first line.");
474474
// TESTING BROKEN BEHAVIOR:
@@ -480,7 +480,7 @@ mod test {
480480
#[should_fail]
481481
fn t2 () {
482482
let cm = CodeMap::new();
483-
let fm = cm.new_filemap(@"blork.rs",@"first line.\nsecond line");
483+
let fm = cm.new_filemap(~"blork.rs",~"first line.\nsecond line");
484484
// TESTING *REALLY* BROKEN BEHAVIOR:
485485
fm.next_line(BytePos(0));
486486
fm.next_line(BytePos(10));

branches/dist-snap/src/libsyntax/ext/expand.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,11 +1021,11 @@ mod test {
10211021
// make sure that macros can leave scope
10221022
#[should_fail]
10231023
#[test] fn macros_cant_escape_fns_test () {
1024-
let src = @"fn bogus() {macro_rules! z (() => (3+4))}\
1024+
let src = ~"fn bogus() {macro_rules! z (() => (3+4))}\
10251025
fn inty() -> int { z!() }";
10261026
let sess = parse::new_parse_sess(None);
10271027
let crate_ast = parse::parse_crate_from_source_str(
1028-
@"<test>",
1028+
~"<test>",
10291029
src,
10301030
~[],sess);
10311031
// should fail:
@@ -1036,11 +1036,11 @@ mod test {
10361036
// make sure that macros can leave scope for modules
10371037
#[should_fail]
10381038
#[test] fn macros_cant_escape_mods_test () {
1039-
let src = @"mod foo {macro_rules! z (() => (3+4))}\
1039+
let src = ~"mod foo {macro_rules! z (() => (3+4))}\
10401040
fn inty() -> int { z!() }";
10411041
let sess = parse::new_parse_sess(None);
10421042
let crate_ast = parse::parse_crate_from_source_str(
1043-
@"<test>",
1043+
~"<test>",
10441044
src,
10451045
~[],sess);
10461046
// should fail:
@@ -1050,11 +1050,11 @@ mod test {
10501050
10511051
// macro_escape modules shouldn't cause macros to leave scope
10521052
#[test] fn macros_can_escape_flattened_mods_test () {
1053-
let src = @"#[macro_escape] mod foo {macro_rules! z (() => (3+4))}\
1053+
let src = ~"#[macro_escape] mod foo {macro_rules! z (() => (3+4))}\
10541054
fn inty() -> int { z!() }";
10551055
let sess = parse::new_parse_sess(None);
10561056
let crate_ast = parse::parse_crate_from_source_str(
1057-
@"<test>",
1057+
~"<test>",
10581058
src,
10591059
~[], sess);
10601060
// should fail:
@@ -1063,23 +1063,23 @@ mod test {
10631063
}
10641064
10651065
#[test] fn test_contains_flatten (){
1066-
let attr1 = make_dummy_attr (@"foo");
1067-
let attr2 = make_dummy_attr (@"bar");
1068-
let escape_attr = make_dummy_attr (@"macro_escape");
1066+
let attr1 = make_dummy_attr ("foo");
1067+
let attr2 = make_dummy_attr ("bar");
1068+
let escape_attr = make_dummy_attr ("macro_escape");
10691069
let attrs1 = ~[attr1, escape_attr, attr2];
10701070
assert_eq!(contains_macro_escape (attrs1),true);
10711071
let attrs2 = ~[attr1,attr2];
10721072
assert_eq!(contains_macro_escape (attrs2),false);
10731073
}
10741074

10751075
// make a MetaWord outer attribute with the given name
1076-
fn make_dummy_attr(s: @str) -> ast::Attribute {
1076+
fn make_dummy_attr(s: &str) -> ast::Attribute {
10771077
Spanned {
10781078
span:codemap::DUMMY_SP,
10791079
node: Attribute_ {
10801080
style: AttrOuter,
10811081
value: @Spanned {
1082-
node: MetaWord(s),
1082+
node: MetaWord(token::intern_and_get_ident(s)),
10831083
span: codemap::DUMMY_SP,
10841084
},
10851085
is_sugared_doc: false,
@@ -1089,7 +1089,7 @@ mod test {
10891089

10901090
#[test]
10911091
fn renaming () {
1092-
let item_ast = string_to_crate(@"fn f() -> int { a }");
1092+
let item_ast = string_to_crate(~"fn f() -> int { a }");
10931093
let a_name = intern("a");
10941094
let a2_name = gensym("a2");
10951095
let mut renamer = new_rename_folder(ast::Ident{name:a_name,ctxt:EMPTY_CTXT},
@@ -1128,7 +1128,7 @@ mod test {
11281128
// pprust::print_crate_(&mut s, crate);
11291129
//}
11301130

1131-
fn expand_crate_str(crate_str: @str) -> ast::Crate {
1131+
fn expand_crate_str(crate_str: ~str) -> ast::Crate {
11321132
let (crate_ast,ps) = string_to_crate_and_sess(crate_str);
11331133
// the cfg argument actually does matter, here...
11341134
let mut loader = ErrLoader;
@@ -1146,7 +1146,7 @@ mod test {
11461146
//}
11471147

11481148
#[test] fn macro_tokens_should_match(){
1149-
expand_crate_str(@"macro_rules! m((a)=>(13)) fn main(){m!(a);}");
1149+
expand_crate_str(~"macro_rules! m((a)=>(13)) fn main(){m!(a);}");
11501150
}
11511151
11521152
// renaming tests expand a crate and then check that the bindings match
@@ -1222,7 +1222,7 @@ mod test {
12221222
let (teststr, bound_connections, bound_ident_check) = match *t {
12231223
(ref str,ref conns, bic) => (str.to_managed(), conns.clone(), bic)
12241224
};
1225-
let cr = expand_crate_str(teststr.to_managed());
1225+
let cr = expand_crate_str(teststr.to_owned());
12261226
// find the bindings:
12271227
let mut name_finder = new_name_finder(~[]);
12281228
visit::walk_crate(&mut name_finder,&cr,());
@@ -1285,7 +1285,7 @@ mod test {
12851285
}
12861286

12871287
#[test] fn fmt_in_macro_used_inside_module_macro() {
1288-
let crate_str = @"macro_rules! fmt_wrap(($b:expr)=>($b.to_str()))
1288+
let crate_str = ~"macro_rules! fmt_wrap(($b:expr)=>($b.to_str()))
12891289
macro_rules! foo_module (() => (mod generated { fn a() { let xx = 147; fmt_wrap!(xx);}}))
12901290
foo_module!()
12911291
";
@@ -1335,7 +1335,7 @@ foo_module!()
13351335

13361336
#[test]
13371337
fn pat_idents(){
1338-
let pat = string_to_pat(@"(a,Foo{x:c @ (b,9),y:Bar(4,d)})");
1338+
let pat = string_to_pat(~"(a,Foo{x:c @ (b,9),y:Bar(4,d)})");
13391339
let mut pat_idents = new_name_finder(~[]);
13401340
pat_idents.visit_pat(pat, ());
13411341
assert_eq!(pat_idents.ident_accumulator,

branches/dist-snap/src/libsyntax/fold.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,8 @@ mod test {
899899
// make sure idents get transformed everywhere
900900
#[test] fn ident_transformation () {
901901
let mut zz_fold = ToZzIdentFolder;
902-
let ast = string_to_crate(@"#[a] mod b {fn c (d : e, f : g) {h!(i,j,k);l;m}}");
902+
let ast = string_to_crate(
903+
~"#[a] mod b {fn c (d : e, f : g) {h!(i,j,k);l;m}}");
903904
assert_pred!(matches_codepattern,
904905
"matches_codepattern",
905906
pprust::to_str(&mut zz_fold.fold_crate(ast),fake_print_crate,
@@ -910,8 +911,9 @@ mod test {
910911
// even inside macro defs....
911912
#[test] fn ident_transformation_in_defs () {
912913
let mut zz_fold = ToZzIdentFolder;
913-
let ast = string_to_crate(@"macro_rules! a {(b $c:expr $(d $e:token)f+
914-
=> (g $(d $d $e)+))} ");
914+
let ast = string_to_crate(
915+
~"macro_rules! a {(b $c:expr $(d $e:token)f+ => \
916+
(g $(d $d $e)+))} ");
915917
assert_pred!(matches_codepattern,
916918
"matches_codepattern",
917919
pprust::to_str(&mut zz_fold.fold_crate(ast),fake_print_crate,

branches/dist-snap/src/libsyntax/parse/lexer.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -972,9 +972,9 @@ mod test {
972972
}
973973

974974
// open a string reader for the given string
975-
fn setup(teststr: @str) -> Env {
975+
fn setup(teststr: ~str) -> Env {
976976
let cm = CodeMap::new();
977-
let fm = cm.new_filemap(@"zebra.rs", teststr);
977+
let fm = cm.new_filemap(~"zebra.rs", teststr);
978978
let span_handler =
979979
diagnostic::mk_span_handler(diagnostic::mk_handler(None),@cm);
980980
Env {
@@ -984,7 +984,7 @@ mod test {
984984

985985
#[test] fn t1 () {
986986
let Env {string_reader} =
987-
setup(@"/* my source file */ \
987+
setup(~"/* my source file */ \
988988
fn main() { println!(\"zebra\"); }\n");
989989
let id = str_to_ident("fn");
990990
let tok1 = string_reader.next_token();
@@ -1020,67 +1020,67 @@ mod test {
10201020
}
10211021

10221022
#[test] fn doublecolonparsing () {
1023-
let env = setup (@"a b");
1023+
let env = setup (~"a b");
10241024
check_tokenization (env,
10251025
~[mk_ident("a",false),
10261026
mk_ident("b",false)]);
10271027
}
10281028

10291029
#[test] fn dcparsing_2 () {
1030-
let env = setup (@"a::b");
1030+
let env = setup (~"a::b");
10311031
check_tokenization (env,
10321032
~[mk_ident("a",true),
10331033
token::MOD_SEP,
10341034
mk_ident("b",false)]);
10351035
}
10361036

10371037
#[test] fn dcparsing_3 () {
1038-
let env = setup (@"a ::b");
1038+
let env = setup (~"a ::b");
10391039
check_tokenization (env,
10401040
~[mk_ident("a",false),
10411041
token::MOD_SEP,
10421042
mk_ident("b",false)]);
10431043
}
10441044

10451045
#[test] fn dcparsing_4 () {
1046-
let env = setup (@"a:: b");
1046+
let env = setup (~"a:: b");
10471047
check_tokenization (env,
10481048
~[mk_ident("a",true),
10491049
token::MOD_SEP,
10501050
mk_ident("b",false)]);
10511051
}
10521052

10531053
#[test] fn character_a() {
1054-
let env = setup(@"'a'");
1054+
let env = setup(~"'a'");
10551055
let TokenAndSpan {tok, sp: _} =
10561056
env.string_reader.next_token();
10571057
assert_eq!(tok,token::LIT_CHAR('a' as u32));
10581058
}
10591059

10601060
#[test] fn character_space() {
1061-
let env = setup(@"' '");
1061+
let env = setup(~"' '");
10621062
let TokenAndSpan {tok, sp: _} =
10631063
env.string_reader.next_token();
10641064
assert_eq!(tok, token::LIT_CHAR(' ' as u32));
10651065
}
10661066

10671067
#[test] fn character_escaped() {
1068-
let env = setup(@"'\\n'");
1068+
let env = setup(~"'\\n'");
10691069
let TokenAndSpan {tok, sp: _} =
10701070
env.string_reader.next_token();
10711071
assert_eq!(tok, token::LIT_CHAR('\n' as u32));
10721072
}
10731073

10741074
#[test] fn lifetime_name() {
1075-
let env = setup(@"'abc");
1075+
let env = setup(~"'abc");
10761076
let TokenAndSpan {tok, sp: _} =
10771077
env.string_reader.next_token();
10781078
let id = token::str_to_ident("abc");
10791079
assert_eq!(tok, token::LIFETIME(id));
10801080
}
10811081

10821082
#[test] fn raw_string() {
1083-
let env = setup(@"r###\"\"#a\\b\x00c\"\"###");
1083+
let env = setup(~"r###\"\"#a\\b\x00c\"\"###");
10841084
let TokenAndSpan {tok, sp: _} =
10851085
env.string_reader.next_token();
10861086
let id = token::str_to_ident("\"#a\\b\x00c\"");
@@ -1094,7 +1094,7 @@ mod test {
10941094
}
10951095

10961096
#[test] fn nested_block_comments() {
1097-
let env = setup(@"/* /* */ */'a'");
1097+
let env = setup(~"/* /* */ */'a'");
10981098
let TokenAndSpan {tok, sp: _} =
10991099
env.string_reader.next_token();
11001100
assert_eq!(tok,token::LIT_CHAR('a' as u32));

branches/dist-snap/src/libsyntax/parse/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ mod test {
314314
}
315315

316316
#[test] fn path_exprs_1() {
317-
assert_eq!(string_to_expr(@"a"),
317+
assert_eq!(string_to_expr(~"a"),
318318
@ast::Expr{
319319
id: ast::DUMMY_NODE_ID,
320320
node: ast::ExprPath(ast::Path {
@@ -333,7 +333,7 @@ mod test {
333333
}
334334
335335
#[test] fn path_exprs_2 () {
336-
assert_eq!(string_to_expr(@"::a::b"),
336+
assert_eq!(string_to_expr(~"::a::b"),
337337
@ast::Expr {
338338
id: ast::DUMMY_NODE_ID,
339339
node: ast::ExprPath(ast::Path {
@@ -358,12 +358,12 @@ mod test {
358358
359359
#[should_fail]
360360
#[test] fn bad_path_expr_1() {
361-
string_to_expr(@"::abc::def::return");
361+
string_to_expr(~"::abc::def::return");
362362
}
363363
364364
// check the token-tree-ization of macros
365365
#[test] fn string_to_tts_macro () {
366-
let tts = string_to_tts(@"macro_rules! zip (($a)=>($a))");
366+
let tts = string_to_tts(~"macro_rules! zip (($a)=>($a))");
367367
match tts {
368368
[ast::TTTok(_,_),
369369
ast::TTTok(_,token::NOT),
@@ -407,7 +407,7 @@ mod test {
407407
}
408408
409409
#[test] fn string_to_tts_1 () {
410-
let tts = string_to_tts(@"fn a (b : int) { b; }");
410+
let tts = string_to_tts(~"fn a (b : int) { b; }");
411411
assert_eq!(to_json_str(&tts),
412412
~"[\
413413
{\
@@ -536,7 +536,7 @@ mod test {
536536
}
537537
538538
#[test] fn ret_expr() {
539-
assert_eq!(string_to_expr(@"return d"),
539+
assert_eq!(string_to_expr(~"return d"),
540540
@ast::Expr{
541541
id: ast::DUMMY_NODE_ID,
542542
node:ast::ExprRet(Some(@ast::Expr{
@@ -559,7 +559,7 @@ mod test {
559559
}
560560
561561
#[test] fn parse_stmt_1 () {
562-
assert_eq!(string_to_stmt(@"b;"),
562+
assert_eq!(string_to_stmt(~"b;"),
563563
@Spanned{
564564
node: ast::StmtExpr(@ast::Expr {
565565
id: ast::DUMMY_NODE_ID,
@@ -585,7 +585,7 @@ mod test {
585585
}
586586
587587
#[test] fn parse_ident_pat () {
588-
let mut parser = string_to_parser(@"b");
588+
let mut parser = string_to_parser(~"b");
589589
assert_eq!(parser.parse_pat(),
590590
@ast::Pat{id: ast::DUMMY_NODE_ID,
591591
node: ast::PatIdent(
@@ -609,7 +609,7 @@ mod test {
609609
// check the contents of the tt manually:
610610
#[test] fn parse_fundecl () {
611611
// this test depends on the intern order of "fn" and "int"
612-
assert_eq!(string_to_item(@"fn a (b : int) { b; }"),
612+
assert_eq!(string_to_item(~"fn a (b : int) { b; }"),
613613
Some(
614614
@ast::Item{ident:str_to_ident("a"),
615615
attrs:~[],
@@ -701,12 +701,12 @@ mod test {
701701
702702
#[test] fn parse_exprs () {
703703
// just make sure that they parse....
704-
string_to_expr(@"3 + 4");
705-
string_to_expr(@"a::z.froob(b,@(987+3))");
704+
string_to_expr(~"3 + 4");
705+
string_to_expr(~"a::z.froob(b,@(987+3))");
706706
}
707707
708708
#[test] fn attrs_fix_bug () {
709-
string_to_item(@"pub fn mk_file_writer(path: &Path, flags: &[FileFlag])
709+
string_to_item(~"pub fn mk_file_writer(path: &Path, flags: &[FileFlag])
710710
-> Result<@Writer, ~str> {
711711
#[cfg(windows)]
712712
fn wb() -> c_int {

0 commit comments

Comments
 (0)