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