Skip to content
Myr

Shrink backtrace capture unsafe block

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 41fde4c · Browse files · 1 file+5 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+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:src/error.rs+5 added-4 removed
46 unmodified lines
47 fn construct<E>(error: E, type_id: TypeId) -> Self48 where49 E: StdError + Send + Sync + 'static,50 {51 let backtrace = match error.backtrace() {52 Some(_) => None,53 None => Some(Backtrace::capture()),54 };5556 unsafe {52 let backtrace = match error.backtrace() {53 Some(_) => None,54 None => Some(Backtrace::capture()),55 };57 let obj: TraitObject = mem::transmute(&error as &dyn StdError);58 let vtable = obj.vtable;59 let inner = ErrorImpl {60 vtable,
294 unmodified lines