From 9aed99e3e34fd9797c0cadebda37441b94fa7f4c Mon Sep 17 00:00:00 2001 From: kyren Date: Mon, 5 Jun 2017 01:05:41 -0400 Subject: [PATCH] atpanic function was not a good idea, it's not sound It crosses the C api boundary, the only proper way to panic would be to actually error guard everywhere, aborting is fine. --- Cargo.toml | 2 +- src/lua.rs | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 94d65f6..74abdbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rlua" -version = "0.4.4" +version = "0.4.5" authors = ["kyren "] description = "High level bindings to Lua 5.3" repository = "https://github.com/chucklefish/rlua" diff --git a/src/lua.rs b/src/lua.rs index a1aeda5..4d02af8 100644 --- a/src/lua.rs +++ b/src/lua.rs @@ -659,15 +659,6 @@ impl Lua { pub fn new() -> Lua { unsafe { let state = ffi::luaL_newstate(); - unsafe extern "C" fn panic_function(state: *mut ffi::lua_State) -> c_int { - if let Some(s) = ffi::lua_tostring(state, -1).as_ref() { - panic!("rlua - unprotected error in call to Lua API ({})", s) - } else { - panic!("rlua - unprotected error in call to Lua API ") - } - } - - ffi::lua_atpanic(state, panic_function); ffi::luaL_openlibs(state); stack_guard(state, 0, || {