Fixing Rust Compilation Errors using LLMs

08/09/2023
by   Pantazis Deligiannis, et al.
0

The Rust programming language, with its safety guarantees, has established itself as a viable choice for low-level systems programming language over the traditional, unsafe alternatives like C/C++. These guarantees come from a strong ownership-based type system, as well as primitive support for features like closures, pattern matching, etc., that make the code more concise and amenable to reasoning. These unique Rust features also pose a steep learning curve for programmers. This paper presents a tool called RustAssistant that leverages the emergent capabilities of Large Language Models (LLMs) to automatically suggest fixes for Rust compilation errors. RustAssistant uses a careful combination of prompting techniques as well as iteration with an LLM to deliver high accuracy of fixes. RustAssistant is able to achieve an impressive peak accuracy of roughly 74 real-world compilation errors in popular open-source Rust repositories. We plan to release our dataset of Rust compilation errors to enable further research.

READ FULL TEXT
research
06/17/2020

Breaking Type-Safety in Go: An Empirical Study on the Usage of the unsafe Package

A decade after its first release, the Go programming language has become...
research
05/12/2019

Static Analyzers and Potential Future Research Directions for Scala: An Overview

Static analyzers are tool sets which are proving to be indispensable to ...
research
03/18/2023

Ownership guided C to Rust translation

Dubbed a safer C, Rust is a modern programming language that combines me...
research
10/11/2021

Robust Safety for Move

A program that maintains key safety properties even when interacting wit...
research
08/05/2019

Mull it over: mutation testing based on LLVM

This paper describes Mull, an open-source tool for mutation testing base...
research
01/04/2019

Identifying Barriers to Adoption for Rust through Online Discourse

Rust is a low-level programming language known for its unique approach t...
research
11/12/2020

The Usability of Ownership

Ownership is the concept of tracking aliases and mutations to data, usef...

Please sign up or login with your details

Forgot password? Click here to reset