]> git.lizzy.rs Git - rust.git/blob - src/test/run-fail/task-spawn-barefn.rs
Auto merge of #63994 - Centril:refactor-qualify-consts, r=spastorino,oli-obk
[rust.git] / src / test / run-fail / task-spawn-barefn.rs
1 // error-pattern:Ensure that the child thread runs by panicking
2 // ignore-emscripten Needs threads.
3
4 use std::thread;
5
6 fn main() {
7     // the purpose of this test is to make sure that thread::spawn()
8     // works when provided with a bare function:
9     let r = thread::spawn(startfn).join();
10     if r.is_err() {
11         panic!()
12     }
13 }
14
15 fn startfn() {
16     assert!("Ensure that the child thread runs by panicking".is_empty());
17 }