diff options
author | kyren <kerriganw@gmail.com> | 2018-02-16 22:00:58 -0500 |
---|---|---|
committer | kyren <kerriganw@gmail.com> | 2018-02-16 22:01:41 -0500 |
commit | dec360f78f156e54a4b4a348e781aedac310b299 (patch) | |
tree | 6251544fa6fc0664a968daa67acc1d064b71544d /src/util.rs | |
parent | 73de52dcce3e222367312ec79743e0b50a134a6c (diff) | |
download | mlua-dec360f78f156e54a4b4a348e781aedac310b299.zip |
Can.. can I do this? Is this a thing that actually works?
Drastic times and all that.
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/util.rs b/src/util.rs index af6a50d..99377fb 100644 --- a/src/util.rs +++ b/src/util.rs @@ -121,7 +121,7 @@ where nresults: c_int, } - #[cfg_attr(feature = "unwind", unwind)] + #[cfg_attr(unwind, unwind)] unsafe extern "C" fn do_call<F, R>(state: *mut ffi::lua_State) -> c_int where F: FnOnce(*mut ffi::lua_State) -> R, @@ -272,7 +272,7 @@ pub unsafe fn take_userdata<T>(state: *mut ffi::lua_State) -> T { ptr::read(ud) } -#[cfg_attr(feature = "unwind", unwind)] +#[cfg_attr(unwind, unwind)] pub unsafe extern "C" fn userdata_destructor<T>(state: *mut ffi::lua_State) -> c_int { callback_error(state, || { take_userdata::<T>(state); @@ -306,7 +306,7 @@ where // Takes an error at the top of the stack, and if it is a WrappedError, converts it to an // Error::CallbackError with a traceback, if it is some lua type, prints the error along with a // traceback, and if it is a WrappedPanic, does not modify it. -#[cfg_attr(feature = "unwind", unwind)] +#[cfg_attr(unwind, unwind)] pub unsafe extern "C" fn error_traceback(state: *mut ffi::lua_State) -> c_int { ffi::luaL_checkstack(state, 2, ptr::null()); @@ -337,7 +337,7 @@ pub unsafe extern "C" fn error_traceback(state: *mut ffi::lua_State) -> c_int { } // A variant of pcall that does not allow lua to catch panic errors from callback_error -#[cfg_attr(feature = "unwind", unwind)] +#[cfg_attr(unwind, unwind)] pub unsafe extern "C" fn safe_pcall(state: *mut ffi::lua_State) -> c_int { ffi::luaL_checkstack(state, 2, ptr::null()); @@ -360,9 +360,9 @@ pub unsafe extern "C" fn safe_pcall(state: *mut ffi::lua_State) -> c_int { } // A variant of xpcall that does not allow lua to catch panic errors from callback_error -#[cfg_attr(feature = "unwind", unwind)] +#[cfg_attr(unwind, unwind)] pub unsafe extern "C" fn safe_xpcall(state: *mut ffi::lua_State) -> c_int { - #[cfg_attr(feature = "unwind", unwind)] + #[cfg_attr(unwind, unwind)] unsafe extern "C" fn xpcall_msgh(state: *mut ffi::lua_State) -> c_int { ffi::luaL_checkstack(state, 2, ptr::null()); @@ -510,7 +510,7 @@ unsafe fn is_wrapped_panic(state: *mut ffi::lua_State, index: c_int) -> bool { unsafe fn get_error_metatable(state: *mut ffi::lua_State) -> c_int { static ERROR_METATABLE_REGISTRY_KEY: u8 = 0; - #[cfg_attr(feature = "unwind", unwind)] + #[cfg_attr(unwind, unwind)] unsafe extern "C" fn error_tostring(state: *mut ffi::lua_State) -> c_int { ffi::luaL_checkstack(state, 2, ptr::null()); @@ -612,7 +612,7 @@ unsafe fn get_panic_metatable(state: *mut ffi::lua_State) -> c_int { unsafe fn get_destructed_userdata_metatable(state: *mut ffi::lua_State) -> c_int { static DESTRUCTED_USERDATA_METATABLE: u8 = 0; - #[cfg_attr(feature = "unwind", unwind)] + #[cfg_attr(unwind, unwind)] unsafe extern "C" fn destructed_error(state: *mut ffi::lua_State) -> c_int { ffi::luaL_checkstack(state, 2, ptr::null()); push_wrapped_error(state, Error::CallbackDestructed); |