2015-05-08 15:12:29 +00:00
|
|
|
// error-pattern:Ensure that the child thread runs by panicking
|
2016-09-06 00:00:09 +00:00
|
|
|
// ignore-emscripten Needs threads.
|
2012-01-08 19:19:44 +00:00
|
|
|
|
2015-02-17 23:10:25 +00:00
|
|
|
use std::thread;
|
2013-05-25 02:35:29 +00:00
|
|
|
|
2012-01-08 19:19:44 +00:00
|
|
|
fn main() {
|
2015-05-08 15:12:29 +00:00
|
|
|
// the purpose of this test is to make sure that thread::spawn()
|
2012-01-08 19:19:44 +00:00
|
|
|
// works when provided with a bare function:
|
2015-02-17 23:10:25 +00:00
|
|
|
let r = thread::spawn(startfn).join();
|
2014-06-26 01:18:13 +00:00
|
|
|
if r.is_err() {
|
2014-10-09 19:17:22 +00:00
|
|
|
panic!()
|
2014-06-26 01:18:13 +00:00
|
|
|
}
|
2012-01-08 19:19:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn startfn() {
|
2015-05-08 17:14:51 +00:00
|
|
|
assert!("Ensure that the child thread runs by panicking".is_empty());
|
2012-01-08 19:19:44 +00:00
|
|
|
}
|