Skip to content

Commit 7ddd7f8

Browse files
committed
zkvm: add #[forbid(unsafe_op_in_unsafe_fn)] in stdlib
This also adds an additional `unsafe` block to address compiler errors.
1 parent 5e4edba commit 7ddd7f8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

std/src/sys/pal/zkvm/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::alloc::{GlobalAlloc, Layout, System};
55
unsafe impl GlobalAlloc for System {
66
#[inline]
77
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
8-
abi::sys_alloc_aligned(layout.size(), layout.align())
8+
unsafe { abi::sys_alloc_aligned(layout.size(), layout.align()) }
99
}
1010

1111
#[inline]

std/src/sys/pal/zkvm/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//! This is all super highly experimental and not actually intended for
77
//! wide/production use yet, it's still all in the experimental category. This
88
//! will likely change over time.
9+
#![forbid(unsafe_op_in_unsafe_fn)]
910

1011
const WORD_SIZE: usize = core::mem::size_of::<u32>();
1112

0 commit comments

Comments
 (0)