Skip to content

Commit 33b7ac1

Browse files
committed
---
yaml --- r: 4777 b: refs/heads/master c: 87a782c h: refs/heads/master i: 4775: b19d7fa v: v3
1 parent 1778920 commit 33b7ac1

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: deef212bf77e84ef35ef33b5725059bb4bf5d154
2+
refs/heads/master: 87a782c0b3034d0833f677ffc1161ddfb4c6765d

trunk/src/lib/test.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,17 +332,13 @@ fn run_test(test: &test_desc, to_task: &test_to_task) -> test_future {
332332
}
333333

334334
// We need to run our tests in another task in order to trap test failures.
335-
// But, at least currently, functions can't be used as spawn arguments so
336-
// we've got to treat our test functions as unsafe pointers. This function
337-
// only works with functions that don't contain closures.
335+
// This function only works with functions that don't contain closures.
338336
fn default_test_to_task(f: &fn()) -> task_id {
339-
fn run_task(fptr: *mutable fn() ) {
337+
fn run_task(f: fn()) {
340338
configure_test_task();
341-
// Run the test
342-
(*fptr)()
339+
f();
343340
}
344-
let fptr = ptr::addr_of(f);
345-
ret task::spawn(bind run_task(fptr));
341+
ret task::spawn(bind run_task(f));
346342
}
347343

348344
// Call from within a test task to make sure it's set up correctly

0 commit comments

Comments
 (0)