diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/threads-sendsync/issue-24313.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/threads-sendsync/issue-24313.rs')
-rw-r--r-- | src/test/ui/threads-sendsync/issue-24313.rs | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/test/ui/threads-sendsync/issue-24313.rs b/src/test/ui/threads-sendsync/issue-24313.rs deleted file mode 100644 index c28b4ca96..000000000 --- a/src/test/ui/threads-sendsync/issue-24313.rs +++ /dev/null @@ -1,32 +0,0 @@ -// run-pass -// ignore-emscripten no threads -// ignore-sgx no processes - -use std::thread; -use std::env; -use std::process::Command; - -struct Handle(i32); - -impl Drop for Handle { - fn drop(&mut self) { panic!(); } -} - -thread_local!(static HANDLE: Handle = Handle(0)); - -fn main() { - let args = env::args().collect::<Vec<_>>(); - if args.len() == 1 { - let out = Command::new(&args[0]).arg("test").output().unwrap(); - let stderr = std::str::from_utf8(&out.stderr).unwrap(); - assert!(stderr.contains("panicked at 'explicit panic'"), - "bad failure message:\n{}\n", stderr); - } else { - // TLS dtors are not always run on process exit - thread::spawn(|| { - HANDLE.with(|h| { - println!("{}", h.0); - }); - }).join().unwrap(); - } -} |