From c8f3203c46c4b95a9eaff3ff8bb99982b682db0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Tue, 29 Nov 2022 11:26:40 +0100 Subject: [PATCH] hermit: Fix fuzzy_provenance_casts --- library/std/src/sys/hermit/thread.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/std/src/sys/hermit/thread.rs b/library/std/src/sys/hermit/thread.rs index e53a1fea6a0..8f65544a9e8 100644 --- a/library/std/src/sys/hermit/thread.rs +++ b/library/std/src/sys/hermit/thread.rs @@ -5,6 +5,7 @@ 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 @@ pub unsafe fn new_with_coreid( extern "C" fn thread_start(main: usize) { unsafe { // Finally, let's run some code. - Box::from_raw(main as *mut Box)(); + Box::from_raw(ptr::from_exposed_addr::>(main).cast_mut())(); // run all destructors run_dtors();