rust/tests/ui/threads-sendsync/spawn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
197 B
Rust
Raw Normal View History

//@ run-pass
//@ needs-threads
2015-02-17 23:24:34 +00:00
use std::thread;
2011-08-11 17:46:57 +00:00
pub fn main() {
thread::spawn(move || child(10)).join().ok().unwrap();
2012-01-05 05:14:53 +00:00
}
fn child(i: isize) {
println!("{}", i);
assert_eq!(i, 10);
}