rust-lang / rust-lang/rust

Drop Elaboration debug-ICEs when `SimplifyCfg` is disabled

Open
#160,945 12 comments 0 reactions 1 assignee View on GitHub

@Catskhi is already working on this.

Since Aug 23, 2026.

A-mir-opt I-ICE requires-debug-assertions
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

https://github.com/rust-lang/rust/pull/160524#issuecomment-5237043839
When compiling the following with debug assertions:

// rustc ice.rs -Zmir-enable-passes=-SimplifyCfg-initial,-SimplifyCfg-promote-consts,-SimplifyCfg-post-analysis
fn mir_drop<T>(_place: T) {
    panic!()
}

fn main() {
    mir_drop(());
}

We get an ICE in dataflow during drop elaboration:

thread 'rustc' panicked at compiler/rustc_mir_dataflow/src/framework/cursor.rs:120:9:
assertion failed: self.reachable_blocks.contains(block)

Full ICE

Unsure if this is an issue in practice, but there does seem to be some implicit dependencies between passes.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.