about summary refs log tree commit diff
path: root/tests/ui/not-panic/not-panic-safe.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/not-panic/not-panic-safe.rs')
-rw-r--r--tests/ui/not-panic/not-panic-safe.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/not-panic/not-panic-safe.rs b/tests/ui/not-panic/not-panic-safe.rs
new file mode 100644
index 00000000000..4165c5dc13a
--- /dev/null
+++ b/tests/ui/not-panic/not-panic-safe.rs
@@ -0,0 +1,10 @@
+#![allow(dead_code)]
+
+use std::panic::UnwindSafe;
+
+fn assert<T: UnwindSafe + ?Sized>() {}
+
+fn main() {
+    assert::<&mut i32>();
+    //~^ ERROR the type `&mut i32` may not be safely transferred across an unwind boundary
+}