From 2658433bd187386cf0c6a10a61d4fa14f229c0fe Mon Sep 17 00:00:00 2001 From: Timidger Date: Sat, 28 Oct 2017 20:46:24 -0700 Subject: [PATCH] Added ability to load debug lib, Fixes #52 --- src/lua.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lua.rs b/src/lua.rs index b765dfd..53a0b4b 100644 --- a/src/lua.rs +++ b/src/lua.rs @@ -557,6 +557,14 @@ impl Lua { } } + /// Loads the Lua debug library. + /// + /// The debug library is very unsound, loading it and using it breaks all + /// the guarantees of rlua. + pub unsafe fn load_debug(&self) { + ffi::luaL_requiref(self.state, cstr!("debug"), ffi::luaopen_debug, 1); + } + /// Loads a chunk of Lua code and returns it as a function. /// /// The source can be named by setting the `name` parameter. This is generally recommended as it