rust-lang / rust-lang/rust

Very large error file creation on exponentially growing type

Open
#157,259 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug D-diagnostic-infra I-heavy T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I tried this code:

struct B<T: 'static>(&'static B<(T, T)>, T);

static BOO: B<u32> = todo!();

I expected to see this happen: compilation error

Instead, this happened: disk space filled up with a large error file (it terminates at some point, just probably not this year).

Meta

rustc --version --verbose:

rustc 1.98.0-nightly (14210df0e 2026-05-31)
binary: rustc
commit-hash: 14210df0e27ccd7d9e6a05b8085cbd438e4bbc65
commit-date: 2026-05-31
host: x86_64-unknown-linux-gnu
release: 1.98.0-nightly
LLVM version: 22.1.6
Backtrace

<backtrace>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by compiling the provided recursive type example with the reported nightly rustc version and observe the generated error output. Trace the compiler behavior responsible for expanding the type and consider the issue done when this input produces a bounded diagnostic instead of filling disk space.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.