Skip to content

Commit

Permalink
Rollup merge of rust-lang#105049 - mkroening:hermit-fixes, r=jyn514
Browse files Browse the repository at this point in the history
Hermit: Minor build fixes

These changes are necessary to build for the hermit targets.

CC: `@stlankes`
  • Loading branch information
matthiaskrgr committed Nov 29, 2022
2 parents 1505fc0 + 0a4e5ef commit 93d698e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions library/std/src/sys/hermit/fs.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 2 additions & 1 deletion library/std/src/sys/hermit/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 93d698e

Please sign in to comment.