arXiv:2608.28713cs.SEAug 2026

Manuscript Offprint

arXiv:2608.28713

Rust's Type Checker Implementation Is Unsound: An Empirical Study on Soundness Bugs in rustc

Yusung Sim, Sukyoung Ryu, Jaemin Hong

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

YUSUNG SIM, KAIST, Republic of Korea

SUKYOUNG RYU, KAIST, Republic of Korea

JAEMIN HONG, UNIST, Republic of Korea and Yale University, USA

Rust is claimed to be a type-sound language capable of preventing various undesirable behaviors, including memory bugs. However, rustc, the official Rust compiler, is not immune to defects; it contains soundness bugs, where the compiler accepts programs that should be rejected during type checking. In this work, we present an empirical study of 30 issues that report potential soundness bugs in rustc, collected from the GitHub issue tracker between January 1, 2022 and September 1, 2025. We analyze each issue in depth, focusing on its affected feature, symptom (how the feature is mishandled), consequence (the resulting undesirable behavior), triggering features, community consensus regarding whether it is a bug, and lifecycle, including introduction, discovery, and fix. Furthermore, we investigate existing artifacts, including implementations such as AddressSanitizer, Miri, Chalk, and a-mir-formality, alongside documentation such as the Rust Reference, the FLS, and Rust RFCs to assess their potential as oracles for testing the type soundness of rustc. Our key findings indicate that: (1) Certain soundness bugs, typically triggered by implied bounds or trait objects, compromise memory safety. (2) Sound type checking is challenged by edge cases involving associated types and the interaction between lifetimes and traits. (3) Most bugs persist from the initial introduction of the relevant features and require significant time to be discovered. (4) While AddressSanitizer and Miri can detect soundness bugs that lead to memory bugs, a-mir-formality and Chalk are currently immature despite their potential to identify other bug categories. (5) Existing documentation frequently fails to provide precise explanations of the language semantics.

CCS Concepts: • Software and its engineering → Compilers; Software defect analysis; Empirical software validation; • Theory of computation → Type theory.

Additional Key Words and Phrases: Rust, type system, compiler bugs, empirical study, rustc

ACM Reference Format:

Yusung Sim, Sukyoung Ryu, and Jaemin Hong. 2026. Rust's Type Checker Implementation Is Unsound: An Empirical Study on Soundness Bugs in rustc. Proc. ACM Softw. Eng. 3, ISSTA, Article ISSTA129 (October 2026), 24 pages. https://doi.org/10.1145/3832220

1 Introduction

Rust [36] is designed to be a type-sound language, aiming to prevent various undesirable behaviors, including memory bugs like use-after-free, at compile time through type checking [27]. Recognizing this benefit, researchers and practitioners have adopted Rust for systems programming to enhance software reliability. Operating systems, web browsers, and network stacks have been developed in Rust [5, 7, 10, 11, 13, 24, 25, 30, 32, 38, 42, 48]; legacy systems, including Linux, have begun integrating Rust [1, 3, 26, 34]; and techniques to translate legacy code into Rust have been extensively

Authors' Contact Information: Yusung Sim, KAIST, Daejeon, Republic of Korea, yusungsim@kaist.ac.kr; Sukyoung Ryu, KAIST, Daejeon, Republic of Korea, sryu.cs@kaist.ac.kr; Jaemin Hong, UNIST, Ulsan, Republic of Korea, jaemin.hong@unist.ac.kr and Yale University, New Haven, USA, jaemin.hong@yale.edu.

Figure

This work is licensed under a Creative Commons Attribution 4.0 International License.

© 2026 Copyright held by the owner/author(s).

ACM 2994-970X/2026/10-ARTISSTA129

https://doi.org/10.1145/3832220

ISSTA129:2

Yusung Sim, Sukyoung Ryu, and Jaemin Hong

studied [8, 16–23, 65, 67, 72–75]. All these lines of work rely on the fundamental assumption that the Rust type checker is sound.

Unfortunately, rustc, the official Rust compiler, is not free from defects. Liu et al. [35] recently demonstrated that the compiler suffers from various bugs, including crashes, miscompilations, and improper diagnostic messages. While all bugs warrant attention, soundness bugs, where the type checker accepts a program that should be rejected, are especially critical, as they undermine Rust's core value of type soundness guarantee. Notably, among the 301 rustc bugs collected by Liu et al., 22 were identified as soundness bugs.

Despite their importance, soundness bugs in the rustc implementation have not yet been studied in depth. For instance, it remains unclear which language features are most prone to soundness bugs, even though such insights would allow researchers to prioritize specific features when developing testing techniques or formalizing the type system. While Liu et al. analyzed rustc bugs and provided valuable insights, their study encompassed all bug categories rather than focusing specifically on soundness bugs. We believe that an in-depth study dedicated to soundness bugs can benefit the community and complement existing work.

In this work, we study 30 soundness issues collected from the rustc GitHub issue tracker, each representing a case where a developer reported that the compiler accepted code that should not pass type checking. We analyze each issue in depth to characterize the following: the affected feature, the symptom (i.e., how the feature is erroneously handled), the consequence (i.e., the specific undesirable behavior enabled by the issue), the features that trigger the issue, the consensus of the community regarding whether it is indeed a bug, and the lifecycle of the issue, encompassing its introduction, discovery, and fix.

Furthermore, we investigate artifacts that can aid in testing the type soundness of rustc. Liu et al.'s study showed that existing testing tools for rustc [6, 14, 29, 43, 49, 64, 68] revealed crash bugs but failed to identify a single soundness bug. A primary reason for this is the absence of a test oracle capable of determining whether a given program should be accepted or rejected. To address this, RustSmith [49] employs differential testing, comparing results across different rustc versions and configurations. However, its effectiveness is limited because most soundness issues persist across multiple versions and settings, as we observe in our study. This underscores the necessity of a test oracle tailored to type soundness.

For this reason, we study the following implementations, which serve as potential test oracles: AddressSanitizer [47] (a memory bug detector), Miri [28, 59] (a Rust interpreter for detecting undefined behavior), Chalk [57] (an implementation of the Rust trait system based on a logic solver), and a-mir-formality [56] (an executable model of the Rust type system). We assess their effectiveness by checking whether they can determine that the programs from the collected issues should be rejected.

In addition, we study existing documentation that explains the semantics of Rust. Previous research has demonstrated that mechanized specifications [40, 69] can serve as effective test oracles for language implementations, detecting numerous bugs in JavaScript engines and transpilers [39, 41, 46] and WebAssembly engines [70], as well as soundness bugs in the P4 type checker [31]. Although Rust currently lacks a full specification [2], documents such as the Rust Reference [60], the FLS [58], and Rust RFCs [62] provide explanations of the semantics. Therefore, we investigate the current state of this documentation and assess whether these explanations are sufficiently clear to develop test oracles for type soundness.

Contributions. Overall, our contributions are as follows:

  • We construct a three-and-a-half-year dataset of 30 soundness issues in rustc (§3).

ISSTA129:3

  • We conduct an empirical study of the soundness issues across multiple dimensions, including their affected features, symptoms, consequences, triggers, consensus, and lifecycles (§4).
  • Based on our analysis, we summarize key findings and provide actionable suggestions for researchers and rustc developers to better detect and mitigate soundness bugs (§5).
  • We assess existing artifacts that could potentially serve as oracles for testing type soundness, discussing their current capabilities and providing guidelines for their use (§6).

Summary of Findings. We summarize our key findings as follows:

  • Certain soundness bugs lead to memory bugs; specifically, implied bounds and trait objects are critical triggering features that can compromise memory safety.
  • Associated types frequently serve as a mechanism for exploiting edge cases in other features, and the interaction between lifetimes and traits poses challenges for sound type checking.
  • Many bugs have persisted since the initial introduction of the relevant features, typically requiring a long time to discover and remaining present across multiple compiler versions.
  • AddressSanitizer and Miri can detect soundness bugs that manifest as memory bugs; other bug categories could be identified by a-mir-formality and Chalk in the future, but they are currently immature.
  • Existing documents are often unclear, and constructing a mechanized specification for Rust cannot be achieved simply by collecting them.

References (37)