π€ AI Summary
This work addresses the challenge posed by unsafe code in Rust, which bypasses the type system and may violate pointer aliasing rules, thereby compromising memory safety and the correctness of compiler optimizations. The paper presents the first modular program logic for unsafe Rust, formally capturing ownership and borrowing semantics to enable static, compositional verification of pointer aliasing constraints. By doing so, it bridges the verification gap left by Rustβs type system within unsafe regions, supporting modular reasoning while ensuring that programs containing unsafe code still adhere to Rustβs memory safety guarantees.
π Abstract
The Rust programming language is famous for its strong ownership regime: at each point, each value is either exclusively owned, exclusively borrowed through a mutable reference, or borrowed as read-only through one or more shared references. These rules, known as Rust's pointer-aliasing rules, are exploited by the Rust compiler to generate more efficient machine code, and enforced by Rust's static type system, except inside unsafe blocks. In this paper, we present our work in progress towards the first program logic for modularly verifying that Rust programs that use unsafe blocks comply with the pointer-aliasing rules.