mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-03 17:35:28 +03:00
hermit: Fix fuzzy_provenance_casts
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
use crate::io;
|
||||
use crate::mem;
|
||||
use crate::num::NonZeroUsize;
|
||||
use crate::ptr;
|
||||
use crate::sys::hermit::abi;
|
||||
use crate::sys::hermit::thread_local_dtor::run_dtors;
|
||||
use crate::time::Duration;
|
||||
@@ -47,7 +48,7 @@ pub unsafe fn new_with_coreid(
|
||||
extern "C" fn thread_start(main: usize) {
|
||||
unsafe {
|
||||
// Finally, let's run some code.
|
||||
Box::from_raw(main as *mut Box<dyn FnOnce()>)();
|
||||
Box::from_raw(ptr::from_exposed_addr::<Box<dyn FnOnce()>>(main).cast_mut())();
|
||||
|
||||
// run all destructors
|
||||
run_dtors();
|
||||
|
||||
Reference in New Issue
Block a user