Skip to content

Commit 81d146b

Browse files
hyperpolymathclaude
andcommitted
chore: add #![forbid(unsafe_code)] to safe Rust crates
Adds the forbid(unsafe_code) crate-level attribute to all Rust crates that do not use unsafe code, hardening the safety guarantee at compile time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a268dc6 commit 81d146b

4 files changed

Lines changed: 4 additions & 0 deletions

File tree

crates/capability/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//! the previous hash, ensuring that any tampering with the system
1515
//! history is detectable via formal verification.
1616
17+
#![forbid(unsafe_code)]
1718
mod dir_capability;
1819
mod audit_log;
1920

crates/fs_ops/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//! 3. **Isolation**: All paths are resolved through a `DirCapability`,
1515
//! eliminating path traversal vulnerabilities at the capability layer.
1616
17+
#![forbid(unsafe_code)]
1718
mod transaction;
1819

1920
pub use transaction::{FsTransaction, FsError, FsOp};

crates/git_ops/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//! 3. **Bitemporal Logic**: Support tracking changes across both the Index
1313
//! and the Working Tree.
1414
15+
#![forbid(unsafe_code)]
1516
use std::path::Path;
1617
use git2::{Repository, StatusOptions};
1718
use serde::{Deserialize, Serialize};

crates/polysafe_nifs/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// ... [Rustler attribute macros and NIF declarations]
1717

1818
// NIF DISPATCH: Routes Elixir calls to the underlying Rust crates.
19+
#![forbid(unsafe_code)]
1920
/*
2021
rustler::init!(
2122
"Elixir.PolysafeGitfixer.Native",

0 commit comments

Comments
 (0)