What Are the Rules for Unsafe Code Soundness?

Unsafe code soundness requires manual adherence to memory safety rules within `unsafe` blocks to prevent undefined behavior.

Unsafe code soundness requires you to manually uphold the compiler's safety guarantees, specifically ensuring no invalid references, data races, or memory corruption occur. You must explicitly mark these blocks with unsafe to acknowledge the responsibility.

unsafe {
    let ptr = 0x01234567usize as *const i32;
    let value = *ptr; // Only safe if ptr is valid and aligned
}