Skip to content

ICE: if_let_guard + mir drop tracking: broken mir #116079

@matthiaskrgr

Description

@matthiaskrgr

Code

rustc -Zvalidate-mir -Zdrop-tracking-mir=yes --edition=2018

#![feature(if_let_guard)]

static mut A: [i32; 5] = [1, 2, 3, 4, 5];

async fn fun() {
    unsafe {
        match A {
            _ => (),
            i if let Some(1) = async { Some(1) }.await => (),
            _ => (),
        }
    }
}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.74.0-nightly (b3aa8e716 2023-09-21)
binary: rustc
commit-hash: b3aa8e7168a3d940122db3561289ffbf3f587262
commit-date: 2023-09-21
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0

Error output

<output>

Metadata

Metadata

Assignees

Labels

-Zvalidate-mirUnstable option: MIR validationA-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-bugCategory: This is a bug.F-if_let_guard`#![feature(if_let_guard)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions