mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
Couple of changes in preparation for 'm' safety:
- auto formatting - add gc control to ffi - add gc_guard to util functions - use gc_guard to make util error handling functions never trigger __gc metamethod Lua errors even without __gc metatable wrapper - sort of a technicality, don't call luaL_requiref outside of the Lua constructor, as it could trigger the garbage collector when user code has had a chance to set __gc metamethods. Changes the API to load the debug table.
This commit is contained in:
+2
-6
@@ -15,12 +15,8 @@ fn test_load() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_load_debug() {
|
||||
let lua = Lua::new();
|
||||
lua.exec::<()>("assert(debug == nil)", None).unwrap();
|
||||
unsafe {
|
||||
lua.load_debug();
|
||||
}
|
||||
fn test_debug() {
|
||||
let lua = unsafe { Lua::new_with_debug() };
|
||||
match lua.eval("debug", None).unwrap() {
|
||||
Value::Table(_) => {}
|
||||
val => panic!("Expected table for debug library, got {:#?}", val),
|
||||
|
||||
Reference in New Issue
Block a user