Skip to content

[ICE][nightly]: "broken MIR in Shim(FutureDropPoll(..)) ... adt field has the wrong type" with async_drop and a reassigned local #164995

Open

Description

@hazohelet

Live Reproducer: playground (nightly, debug)

Compiling the following code with #![feature(async_drop)] crashes rustc.

#![feature(async_drop)]
#![allow(incomplete_features)]

pub async fn f() {
    async {
        let mut v = String::new();
        v = String::new();
        0
    }
    .await;
}
$ rustc +nightly --edition 2024 --crate-type lib a.rs

Output on nightly:

error: internal compiler error: compiler/rustc_mir_transform/src/validate.rs:81:25: broken MIR in Shim(FutureDropPoll(DefId(2:17590 ~ core[581b]::future::async_drop::async_drop_in_place::{closure#0}), Coroutine(..))) (after phase change to runtime-optimized) at bb8[0]:
                                adt field has the wrong type
...
#0 [mir_shims] generating MIR shim for `core::future::async_drop::async_drop_in_place::{closure#0}`, kind=FutureDropPoll(..)
#1 [items_of_instance] collecting items used by `core::future::async_drop::async_drop_in_place::<{async block@a.rs:5:5: 5:10}>::{closure#0} - dropshim(..)`

Notes:

rustc version:

rustc 1.101.0-nightly (19833af72 2026-10-20)

Activity

  1. added
    I-ICE
    T-compiler
    C-bug
    on Oct 26, 2026
  2. added
    needs-triage
    on Oct 26, 2026
  3. added
    F-async_drop
    and removed
    needs-triage
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugF-async_dropI-ICET-compiler

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions