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
425 B
Rust
Raw Normal View History

2020-04-16 06:50:32 +00:00
//@ run-fail
//@ error-pattern:Ensure that the child thread runs by panicking
//@ needs-threads
2015-02-17 23:10:25 +00: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 23:10:25 +00: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());
}