RICE: Harnessing LLMs and Historical Issues to Discover Internal Rust Compiler Errors
Langyi Lu, Wei You, Bin Liang, Jianjun Huang
Abstract
Rust is a modern system-level programming language that emphasizes safety, concurrency, and performance. Ensuring the reliability of the Rust compiler is critical, as undetected compiler defects, particularly internal compiler errors (ICEs), can lead to runtime crashes or undefined behavior in system software. Existing compiler testing methods, including generation-based, mutation-based, and recent LLM-driven approaches, are limited in their ability to systematically uncover ICEs triggered by advanced language features or complex code interactions. In this paper, we propose RICE, an LLM-assisted Rust compiler testing framework that generates test cases by adapting defect-prone patterns extracted from historical ICE issues to diverse code contexts in the official test suite. RICE features simplification-guided identification of defect-prone patterns and contextaware adaptation of patterns to maintain compilability and meaningful semantic interactions. Applied to multiple recent Rust compiler releases, RICE discovered 37 ICEs, including 15 previously unknown zero-day bugs, outperforming existing testing tools in code coverage and ICE discovery. Our results demonstrate that systematically leveraging historical defect-prone patterns enables more effective testing, accelerates bug fixing, and enhances regression testing in Rust compilers.
CCS Concepts: • Security and privacy → Software and application security.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Builds on16
- Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context LearningMingyang Geng, Shangwen Wang, Dezun Dong, Haotian Wang et al.ICSE 2024 · 124 citations
- Understanding memory and thread safety practices and issues in real-world Rust programsBoqin Qin, Yilun Chen, Zeming Yu, Linhai Song et al.PLDI 2020 · 112 citations
- Verus: Verifying Rust Programs using Linear Ghost TypesAndrea Lattuada, Travis Hance, Chanhee Cho, Matthias Brun et al.OOPSLA 2023 · 86 citations
- Large Language Models are Edge-Case Generators: Crafting Unusual Programs for Fuzzing Deep Learning LibrariesYinlin Deng, Chunqiu Steven Xia, Chenyuan Yang, Shizhuo Dylan Zhang et al.ICSE 2024 · 85 citations
- How do programmers use unsafe rust?Vytautas Astrauskas, Christoph Matheja, Federico Poli, Peter Müller et al.OOPSLA 2020 · 78 citations
Related papers
- Clozemaster: Fuzzing Rust Compiler by Harnessing Llms for Infilling Masked Real ProgramsHongyan Gao, Yibiao Yang, Maolin Sun, Jiangchang Wu et al.ICSE 2025 · 6 citations
- Miri: Practical Undefined Behavior Detection for RustRalf Jung, Benjamin Kimock, Christian Poveda, Eduardo Sánchez Muñoz et al.POPL 2026 · 8 citations
- Validating Rust Compilers with Trait-Type Constraint GraphXin Lai, Ming Wen, Xiaofei Liao, Hai JinSOSP 2026
- Rustlantis: Randomized Differential Testing of the Rust CompilerQian Wang, Ralf JungOOPSLA 2024 · 14 citations
- An Empirical Study of Bugs in the rustc CompilerZixi Liu, Yang Feng, Yunbo Ni, Shaohua Li et al.OOPSLA 2025 · 5 citations
