Rust-lancet: Automated Ownership-Rule-Violation Fixing with
Behavior Preservation
Rust-lancet: Automated Ownership-Rule-Violation Fixing with
Behavior Preservation
Rust is a young programming language with safety memory features by its ownership rules.
However, both human-being and automated code generators easily violate ownership rules,
and these violations can result in compilation errors.
Despite the official Rust compiler rustc has some repair hints in compilation error messages,
on a set of 160 erroneous Rust programs, our experiment shows that the repair hint only fixes 45 (28.1\%) programs.
To enhance the usability of Rust, we present Rust-lancet, the first template-based automated Rust ownership violation repair tool with semantic equivalence.
We introduce two novel components:
(1) an iterative template-based repair framework,
(2) a mental semantic to model developer intention for the erroneous program, and the corresponding symbolic executor to
verify the semantic equivalence between the pre-patched and patched program.
Rust-lancet source code is in here