Skip to content

Commit aa674ee

Browse files
authored
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``
2 parents b596d6b + 0a4e5ef commit aa674ee

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Diff for: library/std/src/sys/hermit/fs.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
use crate::convert::TryFrom;
2-
use crate::ffi::{CStr, CString, OsString};
1+
use crate::ffi::{CStr, OsString};
32
use crate::fmt;
43
use crate::hash::{Hash, Hasher};
54
use crate::io::{self, Error, ErrorKind};
65
use crate::io::{BorrowedCursor, IoSlice, IoSliceMut, SeekFrom};
7-
use crate::os::unix::ffi::OsStrExt;
86
use crate::path::{Path, PathBuf};
97
use crate::sys::common::small_c_string::run_path_with_cstr;
108
use crate::sys::cvt;

Diff for: library/std/src/sys/hermit/thread.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::ffi::CStr;
55
use crate::io;
66
use crate::mem;
77
use crate::num::NonZeroUsize;
8+
use crate::ptr;
89
use crate::sys::hermit::abi;
910
use crate::sys::hermit::thread_local_dtor::run_dtors;
1011
use 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();

0 commit comments

Comments
 (0)