Skip to content

Commit c8f3203

Browse files
committed
hermit: Fix fuzzy_provenance_casts
1 parent 2585bce commit c8f3203

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/std/src/sys/hermit/thread.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::ffi::CStr;
55
use crate::io;
66
use crate::mem;
77
use crate::num::NonZeroUsize;
8+
use crate::ptr;
89
use crate::sys::hermit::abi;
910
use crate::sys::hermit::thread_local_dtor::run_dtors;
1011
use crate::time::Duration;
@@ -47,7 +48,7 @@ impl Thread {
4748
extern "C" fn thread_start(main: usize) {
4849
unsafe {
4950
// Finally, let's run some code.
50-
Box::from_raw(main as *mut Box<dyn FnOnce()>)();
51+
Box::from_raw(ptr::from_exposed_addr::<Box<dyn FnOnce()>>(main).cast_mut())();
5152

5253
// run all destructors
5354
run_dtors();

0 commit comments

Comments
 (0)