Foundations for a Rust-Like Borrow Checker for C
summary
Claim: Rust's MIR borrow checker is replicated for C by normalizing C, building a MIR-like CFG, and running a lifetime/ownership analysis that flags ownership/aliasing violations. Implementation uses the Clava source-to-source infrastructure and a TypeScript library Coral, applies source-to-source transformations, encodes borrows via C types, and performs NL lifetime inference. Prototype finds real ownership bugs and reports rustc-like diagnostics; code and artifacts live on the project GitHub.
AI-written summary · about
chapters (13)
- 0:00Rust-like borrow checker for C
- 1:06Memory safety in C and Rust
- 2:34Borrow checker evolution
- 3:41Rust borrows and references
- 6:12Borrow checker error detection
- 7:43Rust MIR overview
- 8:27Coral tool for C analysis
- 9:34Coral's two-phase compilation
- 11:03Challenges and contributions
- 12:09Q&A
- 13:14Future plans for interior mutability
- 14:18Translating C for analysis
- 15:23Extending Coral with safety features
related talks
01h 22mCompile-Time Borrow Checker with Stateful Metaprogramming
37mMemory Safety Everywhere with Both Rust and Carbon
40mBorrowSanitizer: Securing Rust Across Foreign Function Boundaries
28mDetecting Borrow and Provenance Bugs Across Unsafe Rust [...]
15mTranslating C to Safer Rust
01h 01mClosing the Gap between Rust and C++ Using Principles of Static Analysis
35mLet’s Talk About Rust
21mMind the Boundary: Detecting Undefined Behavior Across Rust’s FFI
