diff --git a/src/eyreish/error.rs b/src/eyreish/error.rs index f54ad68..ef92a0c 100644 --- a/src/eyreish/error.rs +++ b/src/eyreish/error.rs @@ -452,8 +452,6 @@ impl Drop for Report { } } -type ErasedErrorImpl = ErrorImpl<()>; - struct ErrorVTable { object_drop: unsafe fn(Own), object_ref: @@ -658,8 +656,10 @@ pub(crate) struct ContextError { pub(crate) error: E, } +type ErasedErrorImpl = ErrorImpl<()>; + // Safety: `ErrorVTable` must be the first field of `ErrorImpl` -unsafe fn vtable(p: NonNull>) -> &'static ErrorVTable { +unsafe fn vtable(p: NonNull) -> &'static ErrorVTable { (p.as_ptr() as *const &'static ErrorVTable).read() }