Rollup merge of #105049 - mkroening:hermit-fixes, r=jyn514
Hermit: Minor build fixes These changes are necessary to build for the hermit targets. CC: ``@stlankes``
This commit is contained in:
commit
aa674eefda
2 changed files with 3 additions and 4 deletions
|
@ -1,10 +1,8 @@
|
|||
use crate::convert::TryFrom;
|
||||
use crate::ffi::{CStr, CString, OsString};
|
||||
use crate::ffi::{CStr, OsString};
|
||||
use crate::fmt;
|
||||
use crate::hash::{Hash, Hasher};
|
||||
use crate::io::{self, Error, ErrorKind};
|
||||
use crate::io::{BorrowedCursor, IoSlice, IoSliceMut, SeekFrom};
|
||||
use crate::os::unix::ffi::OsStrExt;
|
||||
use crate::path::{Path, PathBuf};
|
||||
use crate::sys::common::small_c_string::run_path_with_cstr;
|
||||
use crate::sys::cvt;
|
||||
|
|
|
@ -5,6 +5,7 @@ use crate::ffi::CStr;
|
|||
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 @@ impl Thread {
|
|||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue