about summary refs log tree commit diff
path: root/tests/ui/panics/panic-task-name-owned.rs
blob: 42ae33b5d351b57329687bc7733c6f87d7679c54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ run-fail
//@ error-pattern:thread 'owned name' panicked
//@ error-pattern:test
//@ 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!();
}