summaryrefslogtreecommitdiff
path: root/tests/compile-fail/ref_not_unwindsafe.rs
diff options
context:
space:
mode:
authorkyren <kerriganw@gmail.com>2018-03-28 01:09:51 -0400
committerkyren <kerriganw@gmail.com>2018-03-28 01:09:51 -0400
commit71f3dd50a1f396ea2ff36462e3deb6a48a132c43 (patch)
treebfac178b134bfd15f587305c26dcecfe51f46b0b /tests/compile-fail/ref_not_unwindsafe.rs
parent60bfe1fb077a75b37fa2aef1883db45298761987 (diff)
downloadmlua-71f3dd50a1f396ea2ff36462e3deb6a48a132c43.zip
New approach for ref types, use an auxillary thread stack
Vastly simpler and less magical than using a fixed size magical section of the active stack, and seems to be no slower. The only real downside is that it *seems* extremely extremely hacky (and to be fair, it is).
Diffstat (limited to 'tests/compile-fail/ref_not_unwindsafe.rs')
-rw-r--r--tests/compile-fail/ref_not_unwindsafe.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/compile-fail/ref_not_unwindsafe.rs b/tests/compile-fail/ref_not_unwindsafe.rs
new file mode 100644
index 0000000..5debd16
--- /dev/null
+++ b/tests/compile-fail/ref_not_unwindsafe.rs
@@ -0,0 +1,12 @@
+extern crate rlua;
+
+use std::panic::catch_unwind;
+
+use rlua::*;
+
+fn main() {
+ let lua = Lua::new();
+ let table = lua.create_table().unwrap();
+ let _ = catch_unwind(move || table.set("a", "b").unwrap());
+ //~^ error: the trait bound `std::cell::UnsafeCell<()>: std::panic::RefUnwindSafe` is not satisfied in `rlua::Lua`
+}