zkvm: add #[forbid(unsafe_op_in_unsafe_fn)]
in stdlib
· model-checking/verify-rust-std@7ddd7f8 (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 7ddd7f8
Erik Kaneda
committed
zkvm: add #[forbid(unsafe_op_in_unsafe_fn)]
in stdlib
This also adds an additional `unsafe` block to address compiler errors.
File tree
2 files changed
lines changed
2 files changed
lines changed
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -5,7 +5,7 @@ use crate::alloc::{GlobalAlloc, Layout, System}; | ||
5 | 5 | unsafe impl GlobalAlloc for System { |
6 | 6 | #[inline] |
7 | 7 | 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()) } | |
9 | 9 | } |
10 | 10 | |
11 | 11 | #[inline] |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -6,6 +6,7 @@ | ||
6 | 6 | //! This is all super highly experimental and not actually intended for |
7 | 7 | //! wide/production use yet, it's still all in the experimental category. This |
8 | 8 | //! will likely change over time. |
9 | +#![forbid(unsafe_op_in_unsafe_fn)] | |
9 | 10 | |
10 | 11 | const WORD_SIZE: usize = core::mem::size_of::<u32>(); |
11 | 12 |