Skip to content

Commit e8440a8

Browse files
author
Erik Kaneda
committed
zkvm: add #[deny(unsafe_op_in_unsafe_fn)] in stdlib
This also adds an additional `unsafe` block to address compiler errors.
1 parent 032be6f commit e8440a8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ 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{
9+
abi::sys_alloc_aligned(layout.size(), layout.align())
10+
}
911
}
1012

1113
#[inline]

library/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+
#![deny(unsafe_op_in_unsafe_fn)]
910

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

0 commit comments

Comments
 (0)