about summary refs log tree commit diff
path: root/tests/ui/async-await/context-is-sorta-unwindsafe.rs
diff options
context:
space:
mode:
authorJubilee Young <workingjubilee@gmail.com>2024-05-21 18:55:12 -0700
committerJubilee Young <workingjubilee@gmail.com>2024-05-21 19:05:37 -0700
commit3a21fb5cec07052cb664b6a051e233cd4776283a (patch)
treefb82096b6c12d50619bab73dd6520f72023a08d0 /tests/ui/async-await/context-is-sorta-unwindsafe.rs
parent39e02f1bd1e53d009da382654139f7c0639172a8 (diff)
downloadrust-3a21fb5cec07052cb664b6a051e233cd4776283a.tar.gz
rust-3a21fb5cec07052cb664b6a051e233cd4776283a.zip
Wrap Context.ext in AssertUnwindSafe
Diffstat (limited to 'tests/ui/async-await/context-is-sorta-unwindsafe.rs')
-rw-r--r--tests/ui/async-await/context-is-sorta-unwindsafe.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/async-await/context-is-sorta-unwindsafe.rs b/tests/ui/async-await/context-is-sorta-unwindsafe.rs
new file mode 100644
index 00000000000..278476ea237
--- /dev/null
+++ b/tests/ui/async-await/context-is-sorta-unwindsafe.rs
@@ -0,0 +1,14 @@
+//@ run-pass
+// Tests against a regression surfaced by crater in https://github.com/rust-lang/rust/issues/125193
+// Unwind Safety is not a very coherent concept, but we'd prefer no regressions until we kibosh it
+// and this is an unstable feature anyways sooo...
+
+use std::panic::UnwindSafe;
+use std::task::Context;
+
+fn unwind_safe<T: UnwindSafe>() {}
+
+fn main() {
+    unwind_safe::<Context<'_>>(); // test UnwindSafe
+    unwind_safe::<&Context<'_>>(); // test RefUnwindSafe
+}