diff options
author | Alex Orlenko <zxteam@protonmail.com> | 2020-05-12 02:50:58 +0100 |
---|---|---|
committer | Alex Orlenko <zxteam@protonmail.com> | 2020-05-12 03:16:29 +0100 |
commit | 1492790eced20ccf6f8e838b72a7c035f21dec6b (patch) | |
tree | f0ca4d52e0ee49775a3c06b2d330ef3b4fa93d5f /tests/compile/non_send.rs | |
parent | e88f086ed8b8db6236adf974db28aa9f846d1de8 (diff) | |
download | mlua-1492790eced20ccf6f8e838b72a7c035f21dec6b.zip |
Update compile tests to include async/send features
Diffstat (limited to 'tests/compile/non_send.rs')
-rw-r--r-- | tests/compile/non_send.rs | 17 |
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(()) +} |