diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index 4b24c5fd295..02c933b6fa3 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -174,7 +174,7 @@ fn make_test(config: config, testfile: &Path) -> test::TestDesc { { name: make_test_name(config, testfile), - fn: make_test_closure(config, testfile), + testfn: make_test_closure(config, testfile), ignore: header::is_test_ignored(config, testfile), should_fail: false } diff --git a/src/libstd/test.rs b/src/libstd/test.rs index b1f03f713d8..a2e7be51de8 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -45,7 +45,7 @@ type TestFn = fn~(); // these. type TestDesc = { name: TestName, - fn: TestFn, + testfn: TestFn, ignore: bool, should_fail: bool }; @@ -238,14 +238,14 @@ fn should_sort_failures_before_printing_them() { let test_a = { name: ~"a", - fn: fn~() { }, + testfn: fn~() { }, ignore: false, should_fail: false }; let test_b = { name: ~"b", - fn: fn~() { }, + testfn: fn~() { }, ignore: false, should_fail: false }; @@ -367,7 +367,7 @@ fn filter_tests(opts: TestOpts, fn filter(test: TestDesc) -> Option { if test.ignore { return option::Some({name: test.name, - fn: copy test.fn, + testfn: copy test.testfn, ignore: false, should_fail: test.should_fail}); } else { return option::None; } @@ -396,7 +396,7 @@ fn run_test(+test: TestDesc, monitor_ch: comm::Chan) { } do task::spawn |move test| { - let testfn = copy test.fn; + let testfn = copy test.testfn; let mut result_future = None; // task::future_result(builder); task::task().unlinked().future_result(|+r| { result_future = Some(move r); @@ -425,7 +425,7 @@ mod tests { fn f() { fail; } let desc = { name: ~"whatever", - fn: f, + testfn: f, ignore: true, should_fail: false }; @@ -441,7 +441,7 @@ mod tests { fn f() { } let desc = { name: ~"whatever", - fn: f, + testfn: f, ignore: true, should_fail: false }; @@ -458,7 +458,7 @@ mod tests { fn f() { fail; } let desc = { name: ~"whatever", - fn: f, + testfn: f, ignore: false, should_fail: true }; @@ -474,7 +474,7 @@ mod tests { fn f() { } let desc = { name: ~"whatever", - fn: f, + testfn: f, ignore: false, should_fail: true }; @@ -513,8 +513,10 @@ mod tests { let opts = {filter: option::None, run_ignored: true, logfile: option::None}; let tests = - ~[{name: ~"1", fn: fn~() { }, ignore: true, should_fail: false}, - {name: ~"2", fn: fn~() { }, ignore: false, should_fail: false}]; + ~[{name: ~"1", testfn: fn~() { }, + ignore: true, should_fail: false}, + {name: ~"2", testfn: fn~() { }, + ignore: false, should_fail: false}]; let filtered = filter_tests(opts, tests); assert (vec::len(filtered) == 1u); @@ -539,7 +541,7 @@ mod tests { let testfn = fn~() { }; let mut tests = ~[]; for vec::each(names) |name| { - let test = {name: name, fn: copy testfn, ignore: false, + let test = {name: name, testfn: copy testfn, ignore: false, should_fail: false}; tests += ~[test]; } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 1089431d810..c96cfdfe6bc 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2329,7 +2329,9 @@ impl parser { | ~"owned" => { self.obsolete(copy self.span, ObsoleteLowerCaseKindBounds); - None + // Bogus value, but doesn't matter, since + // is an error + Some(bound_send) } _ => None diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 7ad5c98b498..9786d2141f0 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -414,8 +414,7 @@ fn temporary_keyword_table() -> HashMap<~str, ()> { fn restricted_keyword_table() -> HashMap<~str, ()> { let words = str_hash(); let keys = ~[ - ~"const", ~"copy", - ~"fail", ~"fn", + ~"fail", ~"unsafe" ]; for keys.each |word| { @@ -430,9 +429,10 @@ fn strict_keyword_table() -> HashMap<~str, ()> { let keys = ~[ ~"as", ~"assert", ~"break", + ~"const", ~"copy", ~"do", ~"drop", ~"else", ~"enum", ~"export", ~"extern", - ~"false", ~"for", + ~"false", ~"fn", ~"for", ~"if", ~"impl", ~"let", ~"log", ~"loop", ~"match", ~"mod", ~"move", ~"mut", diff --git a/src/rustc/front/test.rs b/src/rustc/front/test.rs index 60f14f4ca63..3d6dde880ef 100644 --- a/src/rustc/front/test.rs +++ b/src/rustc/front/test.rs @@ -335,7 +335,7 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr { let fn_wrapper_expr = mk_test_wrapper(cx, fn_expr, span); let fn_field: ast::field = - nospan({mutbl: ast::m_imm, ident: cx.sess.ident_of(~"fn"), + nospan({mutbl: ast::m_imm, ident: cx.sess.ident_of(~"testfn"), expr: fn_wrapper_expr}); let ignore_lit: ast::lit = nospan(ast::lit_bool(test.ignore));