mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
zkvm: add #[forbid(unsafe_op_in_unsafe_fn)]
in stdlib
This also adds an additional `unsafe` block to address compiler errors.
This commit is contained in:
parent
032be6f7bb
commit
e48d33e18a
@ -5,7 +5,7 @@ use crate::alloc::{GlobalAlloc, Layout, System};
|
|||||||
unsafe impl GlobalAlloc for System {
|
unsafe impl GlobalAlloc for System {
|
||||||
#[inline]
|
#[inline]
|
||||||
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||||
abi::sys_alloc_aligned(layout.size(), layout.align())
|
unsafe { abi::sys_alloc_aligned(layout.size(), layout.align()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
//! This is all super highly experimental and not actually intended for
|
//! This is all super highly experimental and not actually intended for
|
||||||
//! wide/production use yet, it's still all in the experimental category. This
|
//! wide/production use yet, it's still all in the experimental category. This
|
||||||
//! will likely change over time.
|
//! will likely change over time.
|
||||||
|
#![forbid(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
const WORD_SIZE: usize = core::mem::size_of::<u32>();
|
const WORD_SIZE: usize = core::mem::size_of::<u32>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user