pub unsafe extern "C" fn safe_xpcall(state: *mut ffi::lua_State) -> c_int {
    unsafe extern "C" fn xpcall_msgh(state: *mut ffi::lua_State) -> c_int {
        ffi::luaL_checkstack(state, 2, ptr::null());

        if !get_gc_userdata::<WrappedPanic>(state, -1).is_null() {
            1
        } else {
            ffi::lua_pushvalue(state, ffi::lua_upvalueindex(1));
            ffi::lua_insert(state, 1);
            ffi::lua_call(state, ffi::lua_gettop(state) - 1, ffi::LUA_MULTRET);
            ffi::lua_gettop(state)
        }
    }

    ffi::luaL_checkstack(state, 2, ptr::null());

    let top = ffi::lua_gettop(state);
    if top < 2 {
        ffi::lua_pushstring(state, cstr!("not enough arguments to xpcall"));
        ffi::lua_error(state);
    }

    ffi::lua_pushvalue(state, 2);
    ffi::lua_pushcclosure(state, xpcall_msgh, 1);
    ffi::lua_copy(state, 1, 2);
    ffi::lua_replace(state, 1);

    if ffi::lua_pcall(state, ffi::lua_gettop(state) - 2, ffi::LUA_MULTRET, 1) == ffi::LUA_OK {
        ffi::lua_pushboolean(state, 1);
        ffi::lua_insert(state, 2);
        ffi::lua_gettop(state) - 1
    } else {
        if !get_gc_userdata::<WrappedPanic>(state, -1).is_null() {
            ffi::lua_error(state);
        }
        ffi::lua_pushboolean(state, 0);
        ffi::lua_insert(state, -2);
        2
    }
}
// A variant of `xpcall` that does not allow Lua to catch Rust panics from `callback_error`.
A variant of `xpcall` that does not allow Lua to catch Rust panics from `callback_error`.
A variant of ` xpcall ` that does not allow Lua to catch Rust panics from ` callback_error ` .
pub unsafe extern "C" fn safe_xpcall(state: *mut ffi::lua_State) -> c_int {
    unsafe extern "C" fn xpcall_msgh(state: *mut ffi::lua_State) -> c_int {
        ffi::luaL_checkstack(state, 2, ptr::null());
        if !get_gc_userdata::<WrappedPanic>(state, -1).is_null() {
            1
        } else {
            ffi::lua_pushvalue(state, ffi::lua_upvalueindex(1));
            ffi::lua_insert(state, 1);
            ffi::lua_call(state, ffi::lua_gettop(state) - 1, ffi::LUA_MULTRET);
            ffi::lua_gettop(state)
        }
    }
    ffi::luaL_checkstack(state, 2, ptr::null());
    let top = ffi::lua_gettop(state);
    if top < 2 {
        ffi::lua_pushstring(state, cstr!("not enough arguments to xpcall"));
        ffi::lua_error(state);
    }
    ffi::lua_pushvalue(state, 2);
    ffi::lua_pushcclosure(state, xpcall_msgh, 1);
    ffi::lua_copy(state, 1, 2);
    ffi::lua_replace(state, 1);
    if ffi::lua_pcall(state, ffi::lua_gettop(state) - 2, ffi::LUA_MULTRET, 1) == ffi::LUA_OK {
        ffi::lua_pushboolean(state, 1);
        ffi::lua_insert(state, 2);
        ffi::lua_gettop(state) - 1
    } else {
        if !get_gc_userdata::<WrappedPanic>(state, -1).is_null() {
            ffi::lua_error(state);
        }
        ffi::lua_pushboolean(state, 0);
        ffi::lua_insert(state, -2);
        2
    }
}
pub unsafe extern " " fn safe_xpcall ( state : * mut ffi :: lua_State ) -> c_int { unsafe extern " " fn xpcall_msgh ( state : * mut ffi :: lua_State ) -> c_int { ffi :: luaL_checkstack ( state , 2 , ptr :: null ( ) ) ; if ! get_gc_userdata :: < WrappedPanic > ( state , - 1 ) . is_null ( ) { 1 } else { ffi :: lua_pushvalue ( state , ffi :: lua_upvalueindex ( 1 ) ) ; ffi :: lua_insert ( state , 1 ) ; ffi :: lua_call ( state , ffi :: lua_gettop ( state ) - 1 , ffi :: LUA_MULTRET ) ; ffi :: lua_gettop ( state ) } } ffi :: luaL_checkstack ( state , 2 , ptr :: null ( ) ) ; let top = ffi :: lua_gettop ( state ) ; if top < 2 { ffi :: lua_pushstring ( state , cstr ! ( " " ) ) ; ffi :: lua_error ( state ) ; } ffi :: lua_pushvalue ( state , 2 ) ; ffi :: lua_pushcclosure ( state , xpcall_msgh , 1 ) ; ffi :: lua_copy ( state , 1 , 2 ) ; ffi :: lua_replace ( state , 1 ) ; if ffi :: lua_pcall ( state , ffi :: lua_gettop ( state ) - 2 , ffi :: LUA_MULTRET , 1 ) == ffi :: LUA_OK { ffi :: lua_pushboolean ( state , 1 ) ; ffi :: lua_insert ( state , 2 ) ; ffi :: lua_gettop ( state ) - 1 } else { if ! get_gc_userdata :: < WrappedPanic > ( state , - 1 ) . is_null ( ) { ffi :: lua_error ( state ) ; } ffi :: lua_pushboolean ( state , 0 ) ; ffi :: lua_insert ( state , - 2 ) ; 2 } }
A variant of `xpcall` that does not allow Lua to catch Rust panics from `callback_error`.
A variant of ` xpcall ` that does not allow Lua to catch Rust panics from ` callback_error ` .
state
*mut ffi::lua_State
state
*mut ffi::lua_State