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

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

19 lines
441 B
Rust
Raw Normal View History

2020-04-16 01:50:32 -05:00
// run-fail
// error-pattern:Ensure that the child thread runs by panicking
// ignore-emscripten Needs threads.
2015-02-17 17:10:25 -06:00
use std::thread;
fn main() {
// the purpose of this test is to make sure that thread::spawn()
// works when provided with a bare function:
2015-02-17 17:10:25 -06:00
let r = thread::spawn(startfn).join();
if r.is_err() {
panic!()
}
}
fn startfn() {
assert!("Ensure that the child thread runs by panicking".is_empty());
}