summaryrefslogtreecommitdiff
path: root/tests/compile/non_send.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compile/non_send.rs')
-rw-r--r--tests/compile/non_send.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/compile/non_send.rs b/tests/compile/non_send.rs
new file mode 100644
index 0000000..fe030a5
--- /dev/null
+++ b/tests/compile/non_send.rs
@@ -0,0 +1,17 @@
+use std::cell::Cell;
+use std::rc::Rc;
+
+use mlua::{Lua, Result};
+
+fn main() -> Result<()> {
+ let lua = Lua::new();
+
+ let data = Rc::new(Cell::new(0));
+
+ lua.create_function(move |_, ()| {
+ Ok(data.get())
+ })?
+ .call::<_, i32>(())?;
+
+ Ok(())
+}