Skip to content
Myr

No need for object_raw, object_mut_raw to be unsafe

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 c06155e · 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
372 unmodified lines
373 }374}375376struct ErrorVTable {377 object: unsafe fn(*const ()) -> *const (dyn StdError + Send + Sync + 'static),378 object_mut: unsafe fn(*mut ()) -> *mut (dyn StdError + Send + Sync + 'static),377 object: fn(*const ()) -> *const (dyn StdError + Send + Sync + 'static),378 object_mut: fn(*mut ()) -> *mut (dyn StdError + Send + Sync + 'static),379}380381unsafe fn object_raw<E>(e: *const ()) -> *const (dyn StdError + Send + Sync + 'static)381fn object_raw<E>(e: *const ()) -> *const (dyn StdError + Send + Sync + 'static)382where383 E: StdError + Send + Sync + 'static,384{385 e as *const E386}387388unsafe fn object_mut_raw<E>(e: *mut ()) -> *mut (dyn StdError + Send + Sync + 'static)388fn object_mut_raw<E>(e: *mut ()) -> *mut (dyn StdError + Send + Sync + 'static)389where390 E: StdError + Send + Sync + 'static,391{392 e as *mut E
128 unmodified lines