diff --git a/src/error.rs b/src/error.rs index b447a81..a9a52c1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -183,7 +183,7 @@ impl fmt::Display for Error { } impl failure::Fail for Error { - fn cause(&self) -> Option<&failure::Fail> { + fn cause(&self) -> Option<&dyn failure::Fail> { match *self { Error::CallbackError { ref cause, .. } => Some(cause.as_ref()), Error::ExternalError(ref err) => err.as_fail().cause(), diff --git a/src/types.rs b/src/types.rs index 300467c..90e76fd 100644 --- a/src/types.rs +++ b/src/types.rs @@ -17,7 +17,7 @@ pub type Number = ffi::lua_Number; pub struct LightUserData(pub *mut c_void); pub(crate) type Callback<'lua, 'a> = - Box) -> Result> + 'a>; + Box) -> Result> + 'a>; /// An auto generated key into the Lua registry. /// diff --git a/src/util.rs b/src/util.rs index 544f9d7..57b6441 100644 --- a/src/util.rs +++ b/src/util.rs @@ -661,11 +661,11 @@ pub unsafe fn init_error_metatables(state: *mut ffi::lua_State) { } struct WrappedError(pub Error); -struct WrappedPanic(pub Option>); +struct WrappedPanic(pub Option>); // Pushes a WrappedError::Panic to the top of the stack. Uses two stack spaces and does not call // lua_checkstack. -unsafe fn push_wrapped_panic(state: *mut ffi::lua_State, panic: Box) { +unsafe fn push_wrapped_panic(state: *mut ffi::lua_State, panic: Box) { gc_guard(state, || { let ud = ffi::lua_newuserdata(state, mem::size_of::()) as *mut WrappedPanic; ptr::write(ud, WrappedPanic(Some(panic)))