Skip to content

Drop Elaboration debug-ICEs when SimplifyCfg is disabled #160945

Description

@clubby789

#160524 (comment)
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[(https://github.com/user-attachments/files/30888887/rustc-ice-2026-08-10T06_58_41-132370.txt)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-optArea: MIR optimizationsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions