rust/tests/ui/panics/panic-task-name-owned.rs
2024-02-16 20:02:50 +00:00

20 lines
475 B
Rust

//@ run-fail
//@ error-pattern:thread 'owned name' panicked
//@ error-pattern:test
//@ ignore-emscripten Needs threads.
use std::thread::Builder;
fn main() {
let r: () = Builder::new()
.name("owned name".to_string())
.spawn(move || {
panic!("test");
()
})
.unwrap()
.join()
.unwrap();
panic!();
}