File tree 2 files changed +3
-4
lines changed
library/std/src/sys/hermit
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 } ;
3
2
use crate :: fmt;
4
3
use crate :: hash:: { Hash , Hasher } ;
5
4
use crate :: io:: { self , Error , ErrorKind } ;
6
5
use crate :: io:: { BorrowedCursor , IoSlice , IoSliceMut , SeekFrom } ;
7
- use crate :: os:: unix:: ffi:: OsStrExt ;
8
6
use crate :: path:: { Path , PathBuf } ;
9
7
use crate :: sys:: common:: small_c_string:: run_path_with_cstr;
10
8
use crate :: sys:: cvt;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use crate::ffi::CStr;
5
5
use crate :: io;
6
6
use crate :: mem;
7
7
use crate :: num:: NonZeroUsize ;
8
+ use crate :: ptr;
8
9
use crate :: sys:: hermit:: abi;
9
10
use crate :: sys:: hermit:: thread_local_dtor:: run_dtors;
10
11
use crate :: time:: Duration ;
@@ -47,7 +48,7 @@ impl Thread {
47
48
extern "C" fn thread_start ( main : usize ) {
48
49
unsafe {
49
50
// 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 ( ) ) ( ) ;
51
52
52
53
// run all destructors
53
54
run_dtors ( ) ;
You can’t perform that action at this time.
0 commit comments