File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
library/std/src/sys/hermit Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 1- use crate :: convert:: TryFrom ;
2- use crate :: ffi:: { CStr , CString , OsString } ;
1+ use crate :: ffi:: { CStr , OsString } ;
32use crate :: fmt;
43use crate :: hash:: { Hash , Hasher } ;
54use crate :: io:: { self , Error , ErrorKind } ;
65use crate :: io:: { BorrowedCursor , IoSlice , IoSliceMut , SeekFrom } ;
7- use crate :: os:: unix:: ffi:: OsStrExt ;
86use crate :: path:: { Path , PathBuf } ;
97use crate :: sys:: common:: small_c_string:: run_path_with_cstr;
108use crate :: sys:: cvt;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use crate::ffi::CStr;
55use crate :: io;
66use crate :: mem;
77use crate :: num:: NonZeroUsize ;
8+ use crate :: ptr;
89use crate :: sys:: hermit:: abi;
910use crate :: sys:: hermit:: thread_local_dtor:: run_dtors;
1011use 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 ( ) ;
You can’t perform that action at this time.
0 commit comments