Rust-lancet: Automated Ownership-Rule-Violation Fixing with Behavior Preservation
Wenzhang Yang, Linhai Song, Yinxing Xue
摘要
As a relatively new programming language, Rust is designed to provide both memory safety and runtime performance. To achieve this goal, Rust conducts rigorous static checks against its safety rules during compilation, effectively eliminating memory safety issues that plague C/C++ programs. Although useful, the safety rules pose programming challenges to Rust programmers, since programmers can easily violate safety rules when coding in Rust, leading their code to be rejected by the Rust compiler, a fact underscored by a recent user study. There exists a desire to automate the process of fixing safety-rule violations to enhance Rust's programmability. In this paper, we concentrate on Rust's ownership rules and develop rust-lancet to automatically fix their violations. We devise three strategies for altering code, each intended to modify a Rust program and make it pass Rust's compiler checks. Additionally, we introduce mental semantics to model the behaviors of Rust programs that cannot be compiled due to ownership-rule violations. We design an approach to verify whether modified programs preserve their original behaviors before patches are applied. We apply rust-lancet to 160 safety-rule violations from two sources, successfully fixing 102 violations under the optimal configuration -more than rustc and six LLM-based techniques. Notably, rustlancet avoids generating any incorrect patches, a distinction from all other baseline techniques. We also verify the effectiveness of each fixing strategy and behavior preservation validation and affirm the rationale behind these components. CCS CONCEPTS • Software and its engineering → General programming languages; Error handling and recovery; Software development techniques; Error handling and recovery.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper4
- Rug: Turbo Llm for Rust Unit Test GenerationXiang Cheng, Fan Sang, Yizhuo Zhai, Xiaokuan Zhang 等ICSE 2025 · 被引用 6 次
- Rust-twins: Automatic Rust Compiler Testing through Program Mutation and Dual Macros GenerationWenzhang Yang, Cuifeng Gao, Xiaoyuan Liu, Yuekang Li 等ASE 2024 · 被引用 5 次
- Reflections on the Reproducibility of Commercial LLM Performance in Empirical Software Engineering StudiesFlorian Angermeir, Maximilian Amougou, Mark Kreitz, Andreas Bauer 等ICSE 2026 · 被引用 1 次
- Cpp2Rust: Automatic Translation of C++ to Safe RustLucian Popescu, Francisco Gouveia, Henrique Preto, João Silveira 等PLDI 2026 · 被引用 1 次
它引用的顶会 Paper14
- Graph-based, Self-Supervised Program Repair from Diagnostic FeedbackMichihiro Yasunaga, Percy LiangICML 2020 · 被引用 198 次
- Impact of Code Language Models on Automated Program RepairNan Jiang, Kevin Liu, Thibaud Lutellier, Lin TanICSE 2023 · 被引用 164 次
- Alive2: bounded translation validation for LLVMNuno P. Lopes, Juneyoung Lee, Chung-Kil Hur, Zhengyang Liu 等PLDI 2021 · 被引用 109 次
- On the Importance of Building High-quality Training Datasets for Neural Code SearchZhensu Sun, Li Li, Yan Liu, Xiaoning Du 等ICSE 2022 · 被引用 67 次
- Translating C to safer RustMehmet Emre, Ryan Schroeder, Kyle Dewey, Ben HardekopfOOPSLA 2021 · 被引用 60 次
相关 Paper
- Learning and Programming Challenges of Rust: A Mixed-Methods StudyShuofei Zhu, Ziyi Zhang, Boqin Qin, Aiping Xiong 等ICSE 2022 · 被引用 27 次
- Understanding memory and thread safety practices and issues in real-world Rust programsBoqin Qin, Yilun Chen, Zeming Yu, Linhai Song 等PLDI 2020 · 被引用 112 次
- RustAssistant: Using LLMs to Fix Compilation Errors in Rust CodePantazis Deligiannis, Akash Lal, Nikita Mehrotra, Rishi Poddar 等ICSE 2025 · 被引用 6 次
- Lancet: A Formalization Framework for Crash and Exploit PathologyQinrun Dai, Kirby Linvill, Yueqi Chen, Gowtham KakiUSENIX Security 2025
- How do programmers use unsafe rust?Vytautas Astrauskas, Christoph Matheja, Federico Poli, Peter Müller 等OOPSLA 2020 · 被引用 78 次
