Skip to content
Myr

Rename InnerException to ErrorImpl

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 5535ffc · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:src/error.rs+4 added-4 removed
14 unmodified lines
15/// did not provide one16/// - `Error` is represented as a narrow pointer - exactly one word in size,17/// instead of two.18pub struct Error {19 inner: Box<InnerException<()>>,19 inner: Box<ErrorImpl<()>>,20}2122impl Error {23 /// Create a new exception from any error type.
27 unmodified lines
51 None => Some(Backtrace::capture()),52 };53 let obj: TraitObject = mem::transmute(&error as &dyn StdError);54 let vtable = obj.vtable;55 let inner = InnerException {55 let inner = ErrorImpl {56 vtable,57 type_id,58 backtrace,59 error,
142 unmodified lines
202}203204// repr C to ensure that `E` remains in the final position205#[repr(C)]206struct InnerException<E> {206struct ErrorImpl<E> {207 vtable: *const (),208 type_id: TypeId,209 backtrace: Option<Backtrace>,210 error: E,
22 unmodified lines
233}234235impl<M: Display + Debug + 'static> StdError for MessageError<M> {}236237impl InnerException<()> {237impl ErrorImpl<()> {238 fn error(&self) -> &(dyn StdError + Send + Sync + 'static) {239 unsafe {240 mem::transmute(TraitObject {241 data: &self.error,
76 unmodified lines