rust/src/test/run-fail/task-comm-recv-block.rs

20 lines
347 B
Rust
Raw Normal View History

2011-09-20 11:59:25 -07:00
// error-pattern:goodfail
use std;
import task;
import comm;
2011-09-20 11:59:25 -07:00
2011-10-20 20:34:04 -07:00
fn goodfail(&&_i: ()) {
2011-09-20 11:59:25 -07:00
task::yield();
fail "goodfail";
}
fn main() {
task::spawn((), goodfail);
2011-09-20 11:59:25 -07:00
let po = comm::port();
// We shouldn't be able to get past this recv since there's no
// message available
let i: int = comm::recv(po);
fail "badfail";
}