summaryrefslogtreecommitdiff
path: root/tests/compile_fail/scope_callback_capture.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compile_fail/scope_callback_capture.rs')
-rw-r--r--tests/compile_fail/scope_callback_capture.rs22
1 files changed, 0 insertions, 22 deletions
diff --git a/tests/compile_fail/scope_callback_capture.rs b/tests/compile_fail/scope_callback_capture.rs
deleted file mode 100644
index 93667f0..0000000
--- a/tests/compile_fail/scope_callback_capture.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-use mlua::{Lua, Table, Result};
-
-struct Test {
- field: i32,
-}
-
-fn main() {
- let lua = Lua::new();
- lua.scope(|scope| -> Result<()> {
- let mut inner: Option<Table> = None;
- let f = scope
- .create_function_mut(move |lua, t: Table| {
- if let Some(old) = inner.take() {
- // Access old callback `Lua`.
- }
- inner = Some(t);
- Ok(())
- })?;
- f.call::<_, ()>(lua.create_table()?)?;
- Ok(())
- });
-}