Permalink
Browse files

Remove temporary fn# syntax

  • Loading branch information...
1 parent 6fb9d4f commit ebc61e39d78cbea14daf835597223f2f728e4acd @brson brson committed Oct 21, 2011
Showing with 111 additions and 122 deletions.
  1. +4 −15 src/comp/syntax/parse/parser.rs
  2. +1 −1 src/compiletest/compiletest.rs
  3. +1 −1 src/compiletest/procsrv.rs
  4. +5 −5 src/lib/aio.rs
  5. +5 −5 src/lib/task.rs
  6. +2 −2 src/lib/test.rs
  7. +2 −2 src/test/bench/shootout-pfib.rs
  8. +2 −2 src/test/bench/task-perf-spawnalot.rs
  9. +1 −1 src/test/bench/task-perf-vector-party.rs
  10. +2 −2 src/test/bench/task-perf-word-count.rs
  11. +2 −2 src/test/compile-fail/fn-bare-bind.rs
  12. +2 −2 src/test/compile-fail/fn-bare-generic-instantiate1.rs
  13. +2 −2 src/test/compile-fail/fn-bare-generic-instantiate2.rs
  14. +1 −1 src/test/compile-fail/spawn-non-nil-fn.rs
  15. +1 −1 src/test/run-fail/linked-failure.rs
  16. +1 −1 src/test/run-fail/linked-failure2.rs
  17. +2 −2 src/test/run-fail/linked-failure3.rs
  18. +1 −1 src/test/run-fail/task-comm-recv-block.rs
  19. +1 −1 src/test/run-pass/basic-1.rs
  20. +2 −2 src/test/run-pass/basic-2.rs
  21. +2 −2 src/test/run-pass/basic.rs
  22. +1 −1 src/test/run-pass/binops.rs
  23. +1 −1 src/test/run-pass/chan-leak.rs
  24. +1 −1 src/test/run-pass/child-outlives-parent.rs
  25. +1 −1 src/test/run-pass/comm.rs
  26. +1 −1 src/test/run-pass/fn-bare-anon-2.rs
  27. +1 −1 src/test/run-pass/fn-bare-anon.rs
  28. +2 −2 src/test/run-pass/fn-bare-assign.rs
  29. +1 −1 src/test/run-pass/fn-bare-bind-generic.rs
  30. +1 −1 src/test/run-pass/fn-bare-bind.rs
  31. +1 −1 src/test/run-pass/fn-bare-coerce-to-block.rs
  32. +1 −1 src/test/run-pass/fn-bare-coerce-to-shared.rs
  33. +1 −1 src/test/run-pass/fn-bare-item.rs
  34. +1 −1 src/test/run-pass/fn-bare-size.rs
  35. +3 −3 src/test/run-pass/fn-bare-spawn.rs
  36. +1 −1 src/test/run-pass/fn-coerce-field.rs
  37. +1 −1 src/test/run-pass/hashmap-memory.rs
  38. +1 −1 src/test/run-pass/issue-506.rs
  39. +2 −2 src/test/run-pass/issue-507.rs
  40. +2 −2 src/test/run-pass/issue-687.rs
  41. +1 −1 src/test/run-pass/ivec-tag.rs
  42. +1 −1 src/test/run-pass/join.rs
  43. +1 −1 src/test/run-pass/lazychan.rs
  44. +2 −2 src/test/run-pass/linked-failure.rs
  45. +2 −2 src/test/run-pass/lots-a-fail.rs
  46. +1 −1 src/test/run-pass/many.rs
  47. +2 −2 src/test/run-pass/send-iloop.rs
  48. +1 −1 src/test/run-pass/spawn-fn.rs
  49. +1 −1 src/test/run-pass/spawn-module-qualified.rs
  50. +1 −1 src/test/run-pass/spawn-types.rs
  51. +1 −1 src/test/run-pass/spawn.rs
  52. +1 −1 src/test/run-pass/spawn2.rs
  53. +1 −1 src/test/run-pass/task-comm-0.rs
  54. +1 −1 src/test/run-pass/task-comm-1.rs
  55. +1 −1 src/test/run-pass/task-comm-10.rs
  56. +1 −1 src/test/run-pass/task-comm-11.rs
  57. +1 −1 src/test/run-pass/task-comm-12.rs
  58. +1 −1 src/test/run-pass/task-comm-13.rs
  59. +1 −1 src/test/run-pass/task-comm-14.rs
  60. +1 −1 src/test/run-pass/task-comm-2.rs
  61. +1 −1 src/test/run-pass/task-comm-3.rs
  62. +1 −1 src/test/run-pass/task-comm-7.rs
  63. +1 −1 src/test/run-pass/task-comm-8.rs
  64. +1 −1 src/test/run-pass/task-comm-9.rs
  65. +1 −1 src/test/run-pass/task-life-0.rs
  66. +2 −2 src/test/run-pass/terminate-in-initializer.rs
  67. +1 −1 src/test/run-pass/threads.rs
  68. +1 −1 src/test/run-pass/unique-send-2.rs
  69. +1 −1 src/test/run-pass/unwind-box.rs
  70. +1 −1 src/test/run-pass/unwind-resource.rs
  71. +1 −1 src/test/run-pass/unwind-resource2.rs
  72. +1 −1 src/test/run-pass/unwind-unique.rs
  73. +1 −1 src/test/run-pass/yield.rs
  74. +1 −1 src/test/run-pass/yield1.rs
  75. +7 −7 src/test/stdtest/task.rs
@@ -2135,20 +2135,12 @@ fn parse_auth(p: parser) -> ast::_auth {
} else { unexpected(p, p.peek()); }
}
-fn parse_fn_item_proto(p: parser) -> ast::proto {
- if p.peek() == token::POUND {
- p.bump();
- ast::proto_bare
- } else {
- ast::proto_bare
- }
+fn parse_fn_item_proto(_p: parser) -> ast::proto {
+ ast::proto_bare
}
fn parse_fn_ty_proto(p: parser) -> ast::proto {
- if p.peek() == token::POUND {
- p.bump();
- ast::proto_bare
- } else if p.peek() == token::AT {
+ if p.peek() == token::AT {
p.bump();
ast::proto_shared(ast::sugar_normal)
} else {
@@ -2157,10 +2149,7 @@ fn parse_fn_ty_proto(p: parser) -> ast::proto {
}
fn parse_fn_anon_proto(p: parser) -> ast::proto {
- if p.peek() == token::POUND {
- p.bump();
- ast::proto_bare
- } else if p.peek() == token::AT {
+ if p.peek() == token::AT {
p.bump();
ast::proto_shared(ast::sugar_normal)
} else {
@@ -195,7 +195,7 @@ fn closure_to_task(cx: cx, configport: port<[u8]>, testfn: fn@()) ->
(cx.config, cx.procsrv.chan, testfile), run_test_task);
}
-fn# run_test_task(args: (common::config, procsrv::reqchan, [u8])) {
+fn run_test_task(args: (common::config, procsrv::reqchan, [u8])) {
let (config, procsrv_chan, testfile) = args;
@@ -39,7 +39,7 @@ fn mk() -> handle {
let setupport = port();
let task = task::spawn_joinable(
chan(setupport),
- fn# (setupchan: chan<chan<request>>) {
+ fn (setupchan: chan<chan<request>>) {
let reqport = port();
let reqchan = chan(reqport);
send(setupchan, reqchan);
View
@@ -49,7 +49,7 @@ fn ip_to_sbuf(ip: net::ip_addr) -> *u8 unsafe {
vec::to_ptr(str::bytes(net::format_addr(ip)))
}
-fn# connect_task(args: (net::ip_addr, int, chan<socket_event>)) {
+fn connect_task(args: (net::ip_addr, int, chan<socket_event>)) {
let (ip, portnum, evt) = args;
let connecter = port();
rustrt::aio_connect(ip_to_sbuf(ip), portnum, chan(connecter));
@@ -84,7 +84,7 @@ fn new_client(client: client, evt: chan<socket_event>) {
log "close message sent";
}
-fn# accept_task(args: (client, chan<server_event>)) {
+fn accept_task(args: (client, chan<server_event>)) {
let (client, events) = args;
log "accept task was spawned";
let p = port();
@@ -94,7 +94,7 @@ fn# accept_task(args: (client, chan<server_event>)) {
log "done accepting";
}
-fn# server_task(args: (net::ip_addr, int, chan<server_event>,
+fn server_task(args: (net::ip_addr, int, chan<server_event>,
chan<server>)) {
let (ip, portnum, events, server) = args;
let accepter = port();
@@ -111,7 +111,7 @@ fn# server_task(args: (net::ip_addr, int, chan<server_event>,
}
}
-fn# request_task(c: chan<ctx>) {
+fn request_task(c: chan<ctx>) {
// Create a port to accept IO requests on
let p = port();
// Hand of its channel to our spawner
@@ -150,7 +150,7 @@ fn# request_task(c: chan<ctx>) {
}
}
-fn# iotask(c: chan<ctx>) {
+fn iotask(c: chan<ctx>) {
log "io task spawned";
// Initialize before accepting requests
rustrt::aio_init();
View
@@ -93,16 +93,16 @@ fn unpin() { rustrt::unpin_task(); }
fn set_min_stack(stack_size: uint) { rustrt::set_min_stack(stack_size); }
-fn spawn<~T>(-data: T, f: fn#(T)) -> task {
+fn spawn<~T>(-data: T, f: fn(T)) -> task {
spawn_inner2(data, f, none)
}
-fn spawn_notify<~T>(-data: T, f: fn#(T),
+fn spawn_notify<~T>(-data: T, f: fn(T),
notify: comm::chan<task_notification>) -> task {
spawn_inner2(data, f, some(notify))
}
-fn spawn_joinable<~T>(-data: T, f: fn#(T)) -> joinable_task {
+fn spawn_joinable<~T>(-data: T, f: fn(T)) -> joinable_task {
let p = comm::port::<task_notification>();
let id = spawn_notify(data, f, comm::chan::<task_notification>(p));
ret (id, p);
@@ -118,11 +118,11 @@ fn spawn_joinable<~T>(-data: T, f: fn#(T)) -> joinable_task {
//
// After the transition this should all be rewritten.
-fn spawn_inner2<~T>(-data: T, f: fn#(T),
+fn spawn_inner2<~T>(-data: T, f: fn(T),
notify: option<comm::chan<task_notification>>)
-> task_id {
- fn wrapper<~T>(-data: *u8, f: fn#(T)) {
+ fn wrapper<~T>(-data: *u8, f: fn(T)) {
let data: ~T = unsafe::reinterpret_cast(data);
f(*data);
}
View
@@ -43,7 +43,7 @@ type test_name = str;
// to support isolation of tests into tasks.
type test_fn<@T> = T;
-type default_test_fn = test_fn<fn#()>;
+type default_test_fn = test_fn<fn()>;
// The definition of a single test. A test runner will run a list of
// these.
@@ -321,7 +321,7 @@ fn run_test<@T>(test: test_desc<T>,
// We need to run our tests in another task in order to trap test failures.
// This function only works with functions that don't contain closures.
fn default_test_to_task(&&f: default_test_fn) -> joinable {
- fn# run_task(f: default_test_fn) {
+ fn run_task(f: default_test_fn) {
configure_test_task();
f();
}
@@ -27,7 +27,7 @@ import std::comm::send;
import std::comm::recv;
fn fib(n: int) -> int {
- fn# pfib(args: (chan<int>, int)) {
+ fn pfib(args: (chan<int>, int)) {
let (c, n) = args;
if n == 0 {
send(c, 0);
@@ -62,7 +62,7 @@ fn parse_opts(argv: [str]) -> config {
}
}
-fn# stress_task(&&id: int) {
+fn stress_task(&&id: int) {
let i = 0;
while true {
let n = 15;
@@ -4,15 +4,15 @@ import std::task;
import std::uint;
import std::str;
-fn# f(&&n: uint) {
+fn f(&&n: uint) {
let i = 0u;
while i < n {
task::join(task::spawn_joinable((), g));
i += 1u;
}
}
-fn# g(&&_i: ()) { }
+fn g(&&_i: ()) { }
fn main(args: [str]) {
let n =
@@ -9,7 +9,7 @@ import std::uint;
import std::str;
import std::task;
-fn# f(&&n: uint) {
+fn f(&&n: uint) {
for each i in uint::range(0u, n) {
let v: [u8] = [];
vec::reserve(v, 1000u);
@@ -75,7 +75,7 @@ mod map_reduce {
ret tasks;
}
- fn# map_task(args: (chan<ctrl_proto>, str)) {
+ fn map_task(args: (chan<ctrl_proto>, str)) {
let (ctrl, input) = args;
// log_err "map_task " + input;
let intermediates = map::new_str_hash();
@@ -108,7 +108,7 @@ mod map_reduce {
send(ctrl, mapper_done);
}
- fn# reduce_task(args: (str, chan<chan<reduce_proto>>)) {
+ fn reduce_task(args: (str, chan<chan<reduce_proto>>)) {
let (key, out) = args;
let p = port();
@@ -1,9 +1,9 @@
// error-pattern:mismatched types: expected fn() but found fn@()
-fn# f() {
+fn f() {
}
fn main() {
// Can't produce a bare function by binding
- let g: fn#() = bind f();
+ let g: fn() = bind f();
}
@@ -2,9 +2,9 @@
// Issue #1038
fn main() {
- fn# foo<T>() { }
+ fn foo<T>() { }
// This wants to build a closure over type int,
// but there's no way to do that while still being a bare function
- let f: fn#() = foo::<int>;
+ let f: fn() = foo::<int>;
}
@@ -2,12 +2,12 @@
// Issue #1038
fn main() {
- fn# foo<T>(i: T) { }
+ fn foo<T>(i: T) { }
// This wants to build a closure over type int,
// but there's no way to do that while still being a bare function
f(foo);
}
-fn f(i: fn#(&&int)) {
+fn f(i: fn(&&int)) {
}
@@ -3,6 +3,6 @@
use std;
import std::task;
-fn# f(&&x: int) -> int { ret x; }
+fn f(&&x: int) -> int { ret x; }
fn main() { task::spawn(10, f); }
@@ -6,7 +6,7 @@ import std::task;
import std::comm::port;
import std::comm::recv;
-fn# child(&&_i: ()) { assert (1 == 2); }
+fn child(&&_i: ()) { assert (1 == 2); }
fn main() {
let p = port::<int>();
@@ -7,7 +7,7 @@ import std::comm::chan;
import std::comm::port;
import std::comm::recv;
-fn# child(&&_i: ()) { fail; }
+fn child(&&_i: ()) { fail; }
fn main() {
let p = port::<int>();
@@ -6,9 +6,9 @@ import std::task;
import std::comm::port;
import std::comm::recv;
-fn# grandchild(&&_i: ()) { fail; }
+fn grandchild(&&_i: ()) { fail; }
-fn# child(&&_i: ()) {
+fn child(&&_i: ()) {
let p = port::<int>();
task::spawn((), grandchild);
let x = recv(p);
@@ -4,7 +4,7 @@ use std;
import std::task;
import std::comm;
-fn# goodfail(&&_i: ()) {
+fn goodfail(&&_i: ()) {
task::yield();
fail "goodfail";
}
@@ -7,7 +7,7 @@ import std::comm::send;
import std::comm::recv;
import std::task;
-fn# a(c: chan<int>) { send(c, 10); }
+fn a(c: chan<int>) { send(c, 10); }
fn main() {
let p = port();
@@ -7,7 +7,7 @@ import std::comm::chan;
import std::comm::recv;
import std::task;
-fn# a(c: chan<int>) { log "task a0"; log "task a1"; send(c, 10); }
+fn a(c: chan<int>) { log "task a0"; log "task a1"; send(c, 10); }
fn main() {
let p = comm::port();
@@ -19,7 +19,7 @@ fn main() {
log "Finished.";
}
-fn# b(c: chan<int>) {
+fn b(c: chan<int>) {
log "task b0";
log "task b1";
log "task b2";
@@ -7,7 +7,7 @@ import std::comm::chan;
import std::comm::recv;
import std::task;
-fn# a(c: chan<int>) {
+fn a(c: chan<int>) {
if true {
log "task a";
log "task a";
@@ -37,7 +37,7 @@ fn main() {
log "children finished, root finishing";
}
-fn# b(c: chan<int>) {
+fn b(c: chan<int>) {
if true {
log "task b";
log "task b";
@@ -87,7 +87,7 @@ fn test_ptr() {
}
fn test_task() {
- fn# f(&&_i: ()) { }
+ fn f(&&_i: ()) { }
let f1 = f, f2 = f;
let t1 = task::spawn((), f1);
let t2 = task::spawn((), f2);
@@ -12,7 +12,7 @@ tag request { quit; close(chan<bool>); }
type ctx = chan<request>;
-fn# request_task(c: chan<ctx>) {
+fn request_task(c: chan<ctx>) {
let p = port();
send(c, chan(p));
let req: request;
@@ -3,6 +3,6 @@
use std;
import std::task;
-fn# child2(&&s: str) { }
+fn child2(&&s: str) { }
fn main() { let x = task::spawn("hi", child2); }
@@ -16,7 +16,7 @@ fn main() {
assert (y == 10);
}
-fn# child(c: chan<int>) {
+fn child(c: chan<int>) {
log_err "sending";
send(c, 10);
log_err "value sent"
@@ -1,5 +1,5 @@
fn main() {
- let f: fn#() = fn# () {
+ let f: fn() = fn () {
log "This is a bare function"
};
let g;
@@ -1,5 +1,5 @@
fn main() {
- let f: fn#() = fn# () {
+ let f: fn() = fn () {
log "This is a bare function"
};
f();
Oops, something went wrong.

0 comments on commit ebc61e3

Please sign in to comment.