Adventure of a Lifetime: Extract Method Refactoring for Rust
summary
An automated pipeline hoists a candidate function then applies staged repairs to satisfy Rust ownership and lifetimes, implemented as an IntelliJ Rust plugin called REM. A novel static intra-procedural ownership analysis infers borrow vs. move, and lifetimes are resolved by invoking rustc via uses cargo check as lifetime oracle. REM succeeds on 37 of 40 real-world extractions, reproduces developer edits, averages about 1 second per extraction, and outperforms vanilla IntelliJ and rust-analyzer extractions. Extract Method as hoist + repair static intra-procedural ownership analysis
AI-written summary · about
chapters (11)
- 0:00Introduction
- 0:26Extract method refactoring in Rust
- 1:31Challenges in Rust extraction
- 3:19Refactoring as repair problem
- 4:22Step-by-step repair pipeline
- 6:27Live tool demo
- 7:31REM evaluation with research
- 10:42Performance vs existing tools
- 11:22REM limitations and future
- 12:05Conclusion
- 12:28Q&A
related talks
38mThe Rust Borrow Checker: a Deep Dive
56mVisualizing and Explaining Rust's Ownership Model
22mThe Rust Borrow Checker - A Deep Dive
22mFearless Refactoring
36mThe Rust Borrow Checker: A Deep Dive
06m“RustRover in 2025: Code • Debug • AI”
50mConfessions of a Rusty Java developer
27mParsing Rust code considered harmful
