rust-lang / rust-lang/rust

Suggested fixes in case of incremental compilation ICE can be wrong

Open
#151,413 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-diagnostics S-needs-repro T-compiler
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

Code
// don't have it unfortunately
Current output
= note: please follow the instructions below to create a bug report with the provided information
  = note: for incremental compilation bugs, having a reproduction is vital
  = note: an ideal reproduction consists of the code before and some patch that then triggers the bug when applied and compiled again
  = note: as a workaround, you can run `cargo clean -p derive_smart_pointer` or `cargo clean` to allow your project to compile
Desired output
= note: please follow the instructions below to create a bug report with the provided information
  = note: for incremental compilation bugs, having a reproduction is vital
  = note: an ideal reproduction consists of the code before and some patch that then triggers the bug when applied and compiled again
  = note: as a workaround, you can run `cargo clean -p CRATE_NAME` or `cargo clean` to allow your project to compile
Rationale and extra context

So compiler crashes while trying to compile/run an example. I can't reproduce it reliably after cleaning but added the stack trace to the ticket that was open for this problem already.

Now, rustc tries to make a suggestion to how to fix the problem - cargo clean -p derive_smart_pointer. This won't work since derive_smart_pointer is an example, not a crate. Instead it should suggest to clean the whole crate this example belongs to. I imagine it might do something wrong with a binary or a test as well.

Other cases

Rust Version
rustc 1.92.0 (ded5c06cf 2025-12-08)
binary: rustc
commit-hash: ded5c06cf21d2b93bffd5d884aa6e96934ee4234
commit-date: 2025-12-08
host: x86_64-unknown-linux-gnu
release: 1.92.0
LLVM version: 21.1.3
Anything else?

No response

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 with rustc's incremental-compilation ICE diagnostic and the workaround suggestion that emits cargo clean -p ...; the issue does not name a source file or test. Reproduce the example-target case if possible, then verify that the suggested command refers to the owning crate rather than an example, binary, or test target.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.