rust/src/test/run-fail/task-comm-recv-block.rs
2012-08-27 17:22:18 -07:00

20 lines
343 B
Rust

// error-pattern:goodfail
use std;
import task;
import comm;
fn goodfail() {
task::yield();
fail ~"goodfail";
}
fn main() {
task::spawn(|| goodfail() );
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";
}