summaryrefslogtreecommitdiffstats
path: root/src/test/ui/panics/panic-handler-flail-wildly.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/panics/panic-handler-flail-wildly.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/panics/panic-handler-flail-wildly.rs')
-rw-r--r--src/test/ui/panics/panic-handler-flail-wildly.rs56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/test/ui/panics/panic-handler-flail-wildly.rs b/src/test/ui/panics/panic-handler-flail-wildly.rs
deleted file mode 100644
index 679dc7de8..000000000
--- a/src/test/ui/panics/panic-handler-flail-wildly.rs
+++ /dev/null
@@ -1,56 +0,0 @@
-// run-pass
-// needs-unwind
-
-#![allow(stable_features)]
-#![allow(unused_must_use)]
-
-// ignore-emscripten no threads support
-
-#![feature(std_panic)]
-
-use std::panic;
-use std::thread;
-
-fn a() {
- panic::set_hook(Box::new(|_| println!("hello yes this is a")));
- panic::take_hook();
- panic::set_hook(Box::new(|_| println!("hello yes this is a part 2")));
- panic::take_hook();
-}
-
-fn b() {
- panic::take_hook();
- panic::take_hook();
- panic::take_hook();
- panic::take_hook();
- panic::take_hook();
- panic!();
-}
-
-fn c() {
- panic::set_hook(Box::new(|_| ()));
- panic::set_hook(Box::new(|_| ()));
- panic::set_hook(Box::new(|_| ()));
- panic::set_hook(Box::new(|_| ()));
- panic::set_hook(Box::new(|_| ()));
- panic::set_hook(Box::new(|_| ()));
- panic!();
-}
-
-fn main() {
- for _ in 0..10 {
- let mut handles = vec![];
- for _ in 0..10 {
- handles.push(thread::spawn(a));
- }
- for _ in 0..10 {
- handles.push(thread::spawn(b));
- }
- for _ in 0..10 {
- handles.push(thread::spawn(c));
- }
- for handle in handles {
- let _ = handle.join();
- }
- }
-}