Coccinelle for Rust
summary
Coccinelle for Rust implements a semantic-patch engine that uses Rust Analyzer for parsing and type inference and relies on rustfmt for output, matching patterns across crates and rewriting code. It automates many real changes: it updates 200+ call sites in one rule, reproduced 13 commits affecting up to 94 files, and removes 69 pub modifiers across nine files. Current limitations include handling trailing commas, disjunctions, some use-declaration variations, and complex local-variable flows; pretty-printing and config-sensitive conditional code remain work-in-progress.
AI-written summary · about
chapters (5)
- 0:00Introduction to Coccinelle
- 1:05Semantic patches concept
- 7:51Implementation details
- 11:27Testing with Stratis project
- 20:37Conclusion and future work
related talks
28mC2Rust: Migrating Legacy Code to Rust
18mCocoon: Static Information Flow Control in Rust
25m"Compiler-Driven Development: Making Rust Work for You"
14mAn Empirical Study of Bugs in the rustc Compiler
26mFriendly Ferris: Developing Kind Compiler Errors
47mWhat's unique about Rust?
58mRust for The Curious C++ Developers
32mBuilding and Maintaining Rust at Scale
