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

20 lines
344 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
2012-01-06 20:55:56 -08:00
fn goodfail() {
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";
}