Make fn denote a bare function. Convert fn to fn@ as needed
This commit is contained in:
parent
f324704c0a
commit
29ad3bdb10
64 changed files with 263 additions and 248 deletions
|
|
@ -128,8 +128,8 @@ fn test_opts(config: config) -> test::test_opts {
|
|||
}
|
||||
|
||||
type tests_and_conv_fn = {
|
||||
tests: [test::test_desc<fn()>],
|
||||
to_task: fn(fn()) -> test::joinable
|
||||
tests: [test::test_desc<fn@()>],
|
||||
to_task: fn@(fn@()) -> test::joinable
|
||||
};
|
||||
|
||||
fn make_tests(cx: cx) -> tests_and_conv_fn {
|
||||
|
|
@ -167,7 +167,7 @@ fn is_test(config: config, testfile: str) -> bool {
|
|||
}
|
||||
|
||||
fn make_test(cx: cx, testfile: str, configport: port<[u8]>) ->
|
||||
test::test_desc<fn()> {
|
||||
test::test_desc<fn@()> {
|
||||
{name: make_test_name(cx.config, testfile),
|
||||
fn: make_test_closure(testfile, chan(configport)),
|
||||
ignore: header::is_test_ignored(cx.config, testfile)}
|
||||
|
|
@ -178,7 +178,7 @@ fn make_test_name(config: config, testfile: str) -> str {
|
|||
}
|
||||
|
||||
fn make_test_closure(testfile: str,
|
||||
configchan: chan<[u8]>) -> test::test_fn<fn()> {
|
||||
configchan: chan<[u8]>) -> test::test_fn<fn@()> {
|
||||
bind send_config(testfile, configchan)
|
||||
}
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ fn send_config(testfile: str, configchan: chan<[u8]>) {
|
|||
send(configchan, str::bytes(testfile));
|
||||
}
|
||||
|
||||
fn closure_to_task(cx: cx, configport: port<[u8]>, testfn: fn()) ->
|
||||
fn closure_to_task(cx: cx, configport: port<[u8]>, testfn: fn@()) ->
|
||||
test::joinable {
|
||||
testfn();
|
||||
let testfile = recv(configport);
|
||||
|
|
|
|||
|
|
@ -154,13 +154,13 @@ fn worker(p: port<request>) {
|
|||
|
||||
// Only windows needs to set the library path
|
||||
#[cfg(target_os = "win32")]
|
||||
fn maybe_with_lib_path<@T>(path: str, f: fn() -> T) -> T {
|
||||
fn maybe_with_lib_path<@T>(path: str, f: fn@() -> T) -> T {
|
||||
with_lib_path(path, f)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(target_os = "macos")]
|
||||
fn maybe_with_lib_path<@T>(_path: str, f: fn() -> T) -> T {
|
||||
fn maybe_with_lib_path<@T>(_path: str, f: fn@() -> T) -> T {
|
||||
f()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ fn exec_compiled_test(cx: cx, props: test_props, testfile: str) -> procres {
|
|||
}
|
||||
|
||||
fn compose_and_run(cx: cx, testfile: str,
|
||||
make_args: fn(config, str) -> procargs, lib_path: str,
|
||||
make_args: fn@(config, str) -> procargs, lib_path: str,
|
||||
input: option::t<str>) -> procres {
|
||||
let procargs = make_args(cx.config, testfile);
|
||||
ret program_output(cx, testfile, lib_path, procargs.prog, procargs.args,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue