Skip to content
Myr

Update vtable function names to match the implementation names

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 cc6501e · Browse files · 1 file+6 added−6 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+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:src/error.rs+6 added-6 removed
79 unmodified lines
80 where81 E: StdError + Send + Sync + 'static,82 {83 let vtable = &ErrorVTable {84 object: object_raw::<E>,85 object_mut: object_mut_raw::<E>,84 object_raw: object_raw::<E>,85 object_mut_raw: object_mut_raw::<E>,86 };87 let inner = Box::new(ErrorImpl {88 vtable,89 type_id,
296 unmodified lines
386 }387}388389struct ErrorVTable {390 object: fn(*const ()) -> *const (dyn StdError + Send + Sync + 'static),391 object_mut: fn(*mut ()) -> *mut (dyn StdError + Send + Sync + 'static),390 object_raw: fn(*const ()) -> *const (dyn StdError + Send + Sync + 'static),391 object_mut_raw: fn(*mut ()) -> *mut (dyn StdError + Send + Sync + 'static),392}393394fn object_raw<E>(e: *const ()) -> *const (dyn StdError + Send + Sync + 'static)395where
65 unmodified lines
461impl<M> StdError for DisplayError<M> where M: Display + 'static {}462463impl ErrorImpl<()> {464 fn error(&self) -> &(dyn StdError + Send + Sync + 'static) {465 unsafe { &*(self.vtable.object)(&self.error) }465 unsafe { &*(self.vtable.object_raw)(&self.error) }466 }467468 fn error_mut(&mut self) -> &mut (dyn StdError + Send + Sync + 'static) {469 unsafe { &mut *(self.vtable.object_mut)(&mut self.error) }469 unsafe { &mut *(self.vtable.object_mut_raw)(&mut self.error) }470 }471}472473/// Iterator of a chain of source errors.
83 unmodified lines