diff options
Diffstat (limited to 'tests/ui/panics/panic-task-name-owned.rs')
-rw-r--r-- | tests/ui/panics/panic-task-name-owned.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/panics/panic-task-name-owned.rs b/tests/ui/panics/panic-task-name-owned.rs new file mode 100644 index 000000000..f85be7bb8 --- /dev/null +++ b/tests/ui/panics/panic-task-name-owned.rs @@ -0,0 +1,18 @@ +// run-fail +// error-pattern:thread 'owned name' panicked at '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!(); +} |