Back to SBM LibrarySBM ITB · Learning Materials
Research Companion

Is rust used safely by software developers?

  • Ana Nora Evans · University of Virginia
  • Bradford Campbell · University of Virginia
  • Mary Lou Soffa · University of Virginia

conference paper · 2020 · ACM/IEEE International Conference on Software Engineering: Companion Proceedings (ICSE-Companion), pp. 246–257 · doi:10.1145/3377811.3380413

Abstract

Rust, an emerging programming language with explosive growth, provides a robust type system that enables programmers to write memory-safe and data-race free code. To allow access to a machine's hardware and to support low-level performance optimizations, a second language, Unsafe Rust, is embedded in Rust. It contains support for operations that are difficult to statically check, such as C-style pointers for access to arbitrary memory locations and mutable global variables. When a program uses these features, the compiler is unable to statically guarantee the safety properties Rust promotes. In this work, we perform a large-scale empirical study to explore how software developers are using Unsafe Rust in real-world Rust libraries and applications. Our results indicate that software engineers use the keyword unsafe in less than 30% of Rust libraries, but more than half cannot be entirely statically checked by the Rust compiler because of Unsafe Rust hidden somewhere in a library's call chain. We conclude that although the use of the keyword unsafe is limited, the propagation of unsafeness offers a challenge to the claim of Rust as a memory-safe language. Furthermore, we recommend changes to the Rust compiler and to the central Rust repository's interface to help Rust software developers be aware of when their Rust code is unsafe.

Research area

Physical Sciences › Computer Science › Software › Logic, programming, and type systems

Citation trail

Papers this one builds on. Go backward to find the foundational theories and original sources.

You've reached today's free search limit

Without an API key, OpenAlex allows about 100 searches a day. A free API key raises that 10×. Add it to .env.local as OPENALEX_API_KEY. Searches you've already run still work, because results are cached for a day.