]> git.proxmox.com Git - rustc.git/blob - src/test/run-fail/task-spawn-barefn.rs
New upstream version 1.44.1+dfsg1
[rustc.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 }