Expand description
Safety property verification for transpiled Rust code.
Verifies memory safety, type safety, and other Rust safety guarantees.
§Unsafe Code Auditing
This module provides comprehensive auditing of unsafe blocks in generated Rust code:
- Detection and counting of all unsafe blocks
- Confidence scoring for elimination potential
- Suggestions for safer alternatives
- Unsafe density metrics (<5 per 1000 LOC target)
§Example
use decy_verify::{UnsafeAuditor, audit_rust_code};
let rust_code = r#"
fn example() {
unsafe {
let ptr = std::ptr::null_mut();
}
}
"#;
let report = audit_rust_code(rust_code).expect("Failed to audit");
println!("Unsafe blocks found: {}", report.unsafe_blocks.len());
println!("Unsafe density: {:.2}%", report.unsafe_density_percent);Modules§
- diff_
test - Differential testing against GCC semantics (S5).
- lock_
verify - Lock discipline verification (DECY-079).
Structs§
- Compilation
Error - A structured compilation error from rustc
- Compilation
Result - Result of compiling generated Rust code
- Unsafe
Audit Report - Report summarizing unsafe code in a Rust file
- Unsafe
Auditor - Main auditor for analyzing unsafe code
- Unsafe
Block - Represents a single unsafe block found in Rust code
Enums§
- Unsafe
Pattern - Categories of unsafe patterns
Functions§
- audit_
rust_ code - Convenience function to audit Rust code
- verify_
compilation - Verify that generated Rust code compiles by invoking rustc.