rust/src/test/run-pass/yield1.rs
2012-07-30 18:38:15 -07:00

15 lines
269 B
Rust

// -*- rust -*-
use std;
import task;
import task::*;
fn main() {
let mut result = none;
task::task().future_result(|-r| { result = some(r); }).spawn(child);
error!{"1"};
yield();
future::get(option::unwrap(result));
}
fn child() { error!{"2"}; }