We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2585bce commit c8f3203Copy full SHA for c8f3203
library/std/src/sys/hermit/thread.rs
@@ -5,6 +5,7 @@ use crate::ffi::CStr;
5
use crate::io;
6
use crate::mem;
7
use crate::num::NonZeroUsize;
8
+use crate::ptr;
9
use crate::sys::hermit::abi;
10
use crate::sys::hermit::thread_local_dtor::run_dtors;
11
use crate::time::Duration;
@@ -47,7 +48,7 @@ impl Thread {
47
48
extern "C" fn thread_start(main: usize) {
49
unsafe {
50
// Finally, let's run some code.
- Box::from_raw(main as *mut Box<dyn FnOnce()>)();
51
+ Box::from_raw(ptr::from_exposed_addr::<Box<dyn FnOnce()>>(main).cast_mut())();
52
53
// run all destructors
54
run_dtors();
0 commit comments