Skip to content

ICE: broken mir in AsyncDropGlue, place has deref as a later projection (it is only permitted as the first projection) #140975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
matthiaskrgr opened this issue May 13, 2025 · 1 comment
Labels
-Zvalidate-mir Unstable option: MIR validation C-bug Category: This is a bug. F-async_drop `#![feature(async_drop)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features This issue requires the use of incomplete features. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

//@ compile-flags --edition=2021 --crate-type lib -Zvalidate-mir
#![feature(async_drop)]
use std::{future::AsyncDrop, pin::Pin};
struct a {
    b: usize,
}
struct c {
    d: a,
    e: a,
    f: a,
}
impl c {
    fn i(b: usize) -> Self {
        let d = a::i(b);
        let e = a::i(1);
        let f = a::i(2);
        c { d, e, f }
    }
}
impl a {
    fn i(b: usize) -> Self {
        let g = a { b };
        g
    }
}
impl Drop for a {
    fn drop(&mut self) {}
}
impl AsyncDrop for a {
    async fn drop(self: Pin<&mut Self>) {}
}
async fn bar(h: usize) {
    c::i(h);
}

Meta

rustc --version --verbose:

rustc 1.89.0-nightly (8405332bd 2025-05-12)
binary: rustc
commit-hash: 8405332bdf09b153e475f83b8b8ebf8d4e8eb81f
commit-date: 2025-05-12
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.4

Error output

<output>
Backtrace

thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:80:25:
broken MIR in AsyncDropGlue(DefId(2:15267 ~ core[844c]::future::async_drop::async_drop_in_place::{closure#0}), Coroutine(DefId(2:15267 ~ core[844c]::future::async_drop::async_drop_in_place::{closure#0}), [c, (), std::future::ResumeTy, (), (), CoroutineWitness(DefId(2:15267 ~ core[844c]::future::async_drop::async_drop_in_place::{closure#0}), [c]), (*mut c,)])) (after pass MentionedItems) at bb9[0]:
place (*(_6.0: &mut a)) has deref as a later projection (it is only permitted as the first projection)
stack backtrace:
   0:     0x7da4d31596c3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hee27e289fa80eeb0
   1:     0x7da4d3805987 - core::fmt::write::hcb7a95a553d927d7
   2:     0x7da4d48d3411 - std::io::Write::write_fmt::h5f19ce2ac2f30773
   3:     0x7da4d3159522 - std::sys::backtrace::BacktraceLock::print::h967e6c26dabf5676
   4:     0x7da4d315d11a - std::panicking::default_hook::{{closure}}::h4c9e43e4d632c501
   5:     0x7da4d315cc9f - std::panicking::default_hook::ha3c41200eaedb148
   6:     0x7da4d218ac13 - std[a3033ab4cf040dbc]::panicking::update_hook::<alloc[2b9f1e9988cc0e0]::boxed::Box<rustc_driver_impl[2b29d548aa47efe8]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7da4d315d993 - std::panicking::rust_panic_with_hook::h614c9e3cb602169a
   8:     0x7da4d315d68a - std::panicking::begin_panic_handler::{{closure}}::h7175c42c4098b33c
   9:     0x7da4d3159b89 - std::sys::backtrace::__rust_end_short_backtrace::hb28ab4ef577ce3dd
  10:     0x7da4d315d34d - __rustc[9e838b297ad6583e]::rust_begin_unwind
  11:     0x7da4cfa86220 - core::panicking::panic_fmt::hee3e8e41a6e23382
  12:     0x7da4d0d38bd2 - <rustc_mir_transform[86a227439405b463]::validate::CfgChecker>::fail::<alloc[2b9f1e9988cc0e0]::string::String>
  13:     0x7da4d493af6b - <rustc_mir_transform[86a227439405b463]::validate::Validator as rustc_mir_transform[86a227439405b463]::pass_manager::MirPass>::run_pass
  14:     0x7da4d19db165 - rustc_mir_transform[86a227439405b463]::pass_manager::validate_body
  15:     0x7da4d3803d91 - rustc_mir_transform[86a227439405b463]::pass_manager::run_passes_inner
  16:     0x7da4d4345d85 - rustc_mir_transform[86a227439405b463]::shim::make_shim
  17:     0x7da4d4343cef - rustc_query_impl[c99fb05ce5425a5b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c99fb05ce5425a5b]::query_impl::mir_shims::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 8usize]>>
  18:     0x7da4d4343ca3 - <rustc_query_impl[c99fb05ce5425a5b]::query_impl::mir_shims::dynamic_query::{closure#2} as core[844c48195e089da5]::ops::function::FnOnce<(rustc_middle[c35c93541fbaf6fb]::ty::context::TyCtxt, rustc_middle[c35c93541fbaf6fb]::ty::instance::InstanceKind)>>::call_once
  19:     0x7da4d40115c8 - rustc_query_system[13fd671b9de95920]::query::plumbing::try_execute_query::<rustc_query_impl[c99fb05ce5425a5b]::DynamicConfig<rustc_query_system[13fd671b9de95920]::query::caches::DefaultCache<rustc_middle[c35c93541fbaf6fb]::ty::instance::InstanceKind, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[c99fb05ce5425a5b]::plumbing::QueryCtxt, false>
  20:     0x7da4d40112e6 - rustc_query_impl[c99fb05ce5425a5b]::query_impl::mir_shims::get_query_non_incr::__rust_end_short_backtrace
  21:     0x7da4d283af24 - <rustc_middle[c35c93541fbaf6fb]::ty::context::TyCtxt>::coroutine_layout
  22:     0x7da4d3f2fc5b - rustc_ty_utils[c2f95faedb959599]::layout::layout_of_uncached
  23:     0x7da4d3f22b4e - rustc_ty_utils[c2f95faedb959599]::layout::layout_of
  24:     0x7da4d3f22aaa - rustc_query_impl[c99fb05ce5425a5b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c99fb05ce5425a5b]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 16usize]>>
  25:     0x7da4d3f2189c - rustc_query_system[13fd671b9de95920]::query::plumbing::try_execute_query::<rustc_query_impl[c99fb05ce5425a5b]::DynamicConfig<rustc_query_system[13fd671b9de95920]::query::caches::DefaultCache<rustc_middle[c35c93541fbaf6fb]::ty::PseudoCanonicalInput<rustc_middle[c35c93541fbaf6fb]::ty::Ty>, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[c99fb05ce5425a5b]::plumbing::QueryCtxt, false>
  26:     0x7da4d3f214e7 - rustc_query_impl[c99fb05ce5425a5b]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  27:     0x7da4d3f2039a - <core[844c48195e089da5]::iter::adapters::GenericShunt<core[844c48195e089da5]::iter::adapters::by_ref_sized::ByRefSized<core[844c48195e089da5]::iter::adapters::map::Map<core[844c48195e089da5]::slice::iter::Iter<rustc_middle[c35c93541fbaf6fb]::ty::VariantDef>, rustc_ty_utils[c2f95faedb959599]::layout::layout_of_uncached::{closure#20}>>, core[844c48195e089da5]::result::Result<core[844c48195e089da5]::convert::Infallible, &rustc_middle[c35c93541fbaf6fb]::ty::layout::LayoutError>> as core[844c48195e089da5]::iter::traits::iterator::Iterator>::next
  28:     0x7da4d3f27e44 - rustc_ty_utils[c2f95faedb959599]::layout::layout_of_uncached
  29:     0x7da4d3f22b4e - rustc_ty_utils[c2f95faedb959599]::layout::layout_of
  30:     0x7da4d3f22aaa - rustc_query_impl[c99fb05ce5425a5b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c99fb05ce5425a5b]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 16usize]>>
  31:     0x7da4d3f2189c - rustc_query_system[13fd671b9de95920]::query::plumbing::try_execute_query::<rustc_query_impl[c99fb05ce5425a5b]::DynamicConfig<rustc_query_system[13fd671b9de95920]::query::caches::DefaultCache<rustc_middle[c35c93541fbaf6fb]::ty::PseudoCanonicalInput<rustc_middle[c35c93541fbaf6fb]::ty::Ty>, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[c99fb05ce5425a5b]::plumbing::QueryCtxt, false>
  32:     0x7da4d3f214e7 - rustc_query_impl[c99fb05ce5425a5b]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  33:     0x7da4d3f2074a - <core[844c48195e089da5]::iter::adapters::GenericShunt<core[844c48195e089da5]::iter::adapters::by_ref_sized::ByRefSized<core[844c48195e089da5]::iter::adapters::map::Map<core[844c48195e089da5]::slice::iter::Iter<rustc_middle[c35c93541fbaf6fb]::ty::VariantDef>, rustc_ty_utils[c2f95faedb959599]::layout::layout_of_uncached::{closure#20}>>, core[844c48195e089da5]::result::Result<core[844c48195e089da5]::convert::Infallible, &rustc_middle[c35c93541fbaf6fb]::ty::layout::LayoutError>> as core[844c48195e089da5]::iter::traits::iterator::Iterator>::next
  34:     0x7da4d3f27e44 - rustc_ty_utils[c2f95faedb959599]::layout::layout_of_uncached
  35:     0x7da4d3f22b4e - rustc_ty_utils[c2f95faedb959599]::layout::layout_of
  36:     0x7da4d3f22aaa - rustc_query_impl[c99fb05ce5425a5b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c99fb05ce5425a5b]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 16usize]>>
  37:     0x7da4d3f2189c - rustc_query_system[13fd671b9de95920]::query::plumbing::try_execute_query::<rustc_query_impl[c99fb05ce5425a5b]::DynamicConfig<rustc_query_system[13fd671b9de95920]::query::caches::DefaultCache<rustc_middle[c35c93541fbaf6fb]::ty::PseudoCanonicalInput<rustc_middle[c35c93541fbaf6fb]::ty::Ty>, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[c99fb05ce5425a5b]::plumbing::QueryCtxt, false>
  38:     0x7da4d3f214e7 - rustc_query_impl[c99fb05ce5425a5b]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  39:     0x7da4d3f235c0 - rustc_ty_utils[c2f95faedb959599]::layout::layout_of
  40:     0x7da4d3f22aaa - rustc_query_impl[c99fb05ce5425a5b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c99fb05ce5425a5b]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 16usize]>>
  41:     0x7da4d3f2189c - rustc_query_system[13fd671b9de95920]::query::plumbing::try_execute_query::<rustc_query_impl[c99fb05ce5425a5b]::DynamicConfig<rustc_query_system[13fd671b9de95920]::query::caches::DefaultCache<rustc_middle[c35c93541fbaf6fb]::ty::PseudoCanonicalInput<rustc_middle[c35c93541fbaf6fb]::ty::Ty>, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[c99fb05ce5425a5b]::plumbing::QueryCtxt, false>
  42:     0x7da4d3f214e7 - rustc_query_impl[c99fb05ce5425a5b]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  43:     0x7da4d3f33349 - <rustc_middle[c35c93541fbaf6fb]::ty::layout::LayoutCx as rustc_middle[c35c93541fbaf6fb]::ty::layout::LayoutOf>::spanned_layout_of
  44:     0x7da4d30c4e30 - <core[844c48195e089da5]::iter::adapters::GenericShunt<core[844c48195e089da5]::iter::adapters::by_ref_sized::ByRefSized<core[844c48195e089da5]::iter::adapters::map::Map<core[844c48195e089da5]::slice::iter::Iter<rustc_middle[c35c93541fbaf6fb]::mir::query::CoroutineSavedTy>, rustc_ty_utils[c2f95faedb959599]::layout::layout_of_uncached::{closure#12}>>, core[844c48195e089da5]::result::Result<core[844c48195e089da5]::convert::Infallible, &rustc_middle[c35c93541fbaf6fb]::ty::layout::LayoutError>> as core[844c48195e089da5]::iter::traits::iterator::Iterator>::next
  45:     0x7da4d30aec1a - core[844c48195e089da5]::iter::adapters::try_process::<core[844c48195e089da5]::iter::adapters::by_ref_sized::ByRefSized<core[844c48195e089da5]::iter::adapters::map::Map<core[844c48195e089da5]::slice::iter::Iter<rustc_middle[c35c93541fbaf6fb]::mir::query::CoroutineSavedTy>, rustc_ty_utils[c2f95faedb959599]::layout::layout_of_uncached::{closure#12}>>, rustc_abi[a261153e5dfc86cc]::layout::ty::TyAndLayout<rustc_middle[c35c93541fbaf6fb]::ty::Ty>, core[844c48195e089da5]::result::Result<core[844c48195e089da5]::convert::Infallible, &rustc_middle[c35c93541fbaf6fb]::ty::layout::LayoutError>, <core[844c48195e089da5]::iter::adapters::map::Map<core[844c48195e089da5]::slice::iter::Iter<rustc_middle[c35c93541fbaf6fb]::mir::query::CoroutineSavedTy>, rustc_ty_utils[c2f95faedb959599]::layout::layout_of_uncached::{closure#12}> as core[844c48195e089da5]::iter::traits::iterator::Iterator>::try_collect<rustc_index[731be7b9208c99a6]::vec::IndexVec<rustc_middle[c35c93541fbaf6fb]::mir::query::CoroutineSavedLocal, rustc_abi[a261153e5dfc86cc]::layout::ty::TyAndLayout<rustc_middle[c35c93541fbaf6fb]::ty::Ty>>>::{closure#0}, rustc_index[731be7b9208c99a6]::vec::IndexVec<rustc_middle[c35c93541fbaf6fb]::mir::query::CoroutineSavedLocal, rustc_abi[a261153e5dfc86cc]::layout::ty::TyAndLayout<rustc_middle[c35c93541fbaf6fb]::ty::Ty>>>
  46:     0x7da4d3f3027b - rustc_ty_utils[c2f95faedb959599]::layout::layout_of_uncached
  47:     0x7da4d3f22b4e - rustc_ty_utils[c2f95faedb959599]::layout::layout_of
  48:     0x7da4d3f22aaa - rustc_query_impl[c99fb05ce5425a5b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c99fb05ce5425a5b]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 16usize]>>
  49:     0x7da4d3f2189c - rustc_query_system[13fd671b9de95920]::query::plumbing::try_execute_query::<rustc_query_impl[c99fb05ce5425a5b]::DynamicConfig<rustc_query_system[13fd671b9de95920]::query::caches::DefaultCache<rustc_middle[c35c93541fbaf6fb]::ty::PseudoCanonicalInput<rustc_middle[c35c93541fbaf6fb]::ty::Ty>, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[c99fb05ce5425a5b]::plumbing::QueryCtxt, false>
  50:     0x7da4d3f214e7 - rustc_query_impl[c99fb05ce5425a5b]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  51:     0x7da4d461d766 - <rustc_mir_transform[86a227439405b463]::known_panics_lint::KnownPanicsLint as rustc_mir_transform[86a227439405b463]::pass_manager::MirLint>::run_lint
  52:     0x7da4d380bea7 - rustc_mir_transform[86a227439405b463]::run_analysis_to_runtime_passes
  53:     0x7da4d3cbb625 - rustc_mir_transform[86a227439405b463]::mir_drops_elaborated_and_const_checked
  54:     0x7da4d3cbaff7 - rustc_query_impl[c99fb05ce5425a5b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c99fb05ce5425a5b]::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 8usize]>>
  55:     0x7da4d3adc4e6 - rustc_query_system[13fd671b9de95920]::query::plumbing::try_execute_query::<rustc_query_impl[c99fb05ce5425a5b]::DynamicConfig<rustc_data_structures[8c4d114b892fc81f]::vec_cache::VecCache<rustc_span[767accb19bf8aef3]::def_id::LocalDefId, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[13fd671b9de95920]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[c99fb05ce5425a5b]::plumbing::QueryCtxt, false>
  56:     0x7da4d3adbdd2 - rustc_query_impl[c99fb05ce5425a5b]::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
  57:     0x7da4d3d12210 - rustc_interface[b13b618c5853daff]::passes::run_required_analyses
  58:     0x7da4d47db39e - rustc_interface[b13b618c5853daff]::passes::analysis
  59:     0x7da4d47db375 - rustc_query_impl[c99fb05ce5425a5b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c99fb05ce5425a5b]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 0usize]>>
  60:     0x7da4d475363a - rustc_query_system[13fd671b9de95920]::query::plumbing::try_execute_query::<rustc_query_impl[c99fb05ce5425a5b]::DynamicConfig<rustc_query_system[13fd671b9de95920]::query::caches::SingleCache<rustc_middle[c35c93541fbaf6fb]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[c99fb05ce5425a5b]::plumbing::QueryCtxt, false>
  61:     0x7da4d475330f - rustc_query_impl[c99fb05ce5425a5b]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  62:     0x7da4d4a1f0c7 - rustc_interface[b13b618c5853daff]::passes::create_and_enter_global_ctxt::<core[844c48195e089da5]::option::Option<rustc_interface[b13b618c5853daff]::queries::Linker>, rustc_driver_impl[2b29d548aa47efe8]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  63:     0x7da4d48f50a6 - rustc_interface[b13b618c5853daff]::interface::run_compiler::<(), rustc_driver_impl[2b29d548aa47efe8]::run_compiler::{closure#0}>::{closure#1}
  64:     0x7da4d48ca07e - std[a3033ab4cf040dbc]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[b13b618c5853daff]::util::run_in_thread_with_globals<rustc_interface[b13b618c5853daff]::util::run_in_thread_pool_with_globals<rustc_interface[b13b618c5853daff]::interface::run_compiler<(), rustc_driver_impl[2b29d548aa47efe8]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  65:     0x7da4d48ca4eb - <<std[a3033ab4cf040dbc]::thread::Builder>::spawn_unchecked_<rustc_interface[b13b618c5853daff]::util::run_in_thread_with_globals<rustc_interface[b13b618c5853daff]::util::run_in_thread_pool_with_globals<rustc_interface[b13b618c5853daff]::interface::run_compiler<(), rustc_driver_impl[2b29d548aa47efe8]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[844c48195e089da5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  66:     0x7da4d48cb8eb - std::sys::pal::unix::thread::Thread::new::thread_start::hcb4e67cfc7257238
  67:     0x7da4ce6a370a - <unknown>
  68:     0x7da4ce727aac - <unknown>
  69:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/matthias/vcs/github/CRED/rustc-ice-2025-05-13T19_11_20-2230674.txt` to your bug report

note: compiler flags: --crate-type lib -Z validate-mir

query stack during panic:
#0 [mir_shims] generating MIR shim for `core::future::async_drop::async_drop_in_place::{closure#0}`, instance=AsyncDropGlue(DefId(2:15267 ~ core[844c]::future::async_drop::async_drop_in_place::{closure#0}), Coroutine(DefId(2:15267 ~ core[844c]::future::async_drop::async_drop_in_place::{closure#0}), [c, (), core::future::ResumeTy, (), (), CoroutineWitness(DefId(2:15267 ~ core[844c]::future::async_drop::async_drop_in_place::{closure#0}), [c]), (*mut c,)]))
#1 [layout_of] computing layout of `{async fn body of core::future::async_drop::async_drop_in_place<c>()}`
#2 [layout_of] computing layout of `core::mem::manually_drop::ManuallyDrop<{async fn body of core::future::async_drop::async_drop_in_place<c>()}>`
#3 [layout_of] computing layout of `core::mem::maybe_uninit::MaybeUninit<{async fn body of core::future::async_drop::async_drop_in_place<c>()}>`
#4 [layout_of] computing layout of `core::mem::maybe_uninit::MaybeUninit<core::future::async_drop::async_drop_in_place::{opaque#0}>`
#5 [layout_of] computing layout of `{async fn body of bar()}`
#6 [mir_drops_elaborated_and_const_checked] elaborating drops for `bar`
#7 [analysis] running analysis passes on this crate
end of query stack
warning: 3 warnings emitted

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels May 13, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 13, 2025
@matthiaskrgr matthiaskrgr added the F-async_drop `#![feature(async_drop)]` label May 13, 2025
@moxian
Copy link
Contributor

moxian commented May 13, 2025

smaller:

//@ compile-flags --edition=2021 --crate-type lib -Zvalidate-mir
#![feature(async_drop)]
use std::{future::AsyncDrop, pin::Pin};

struct HasAsyncDrop ;
impl Drop for HasAsyncDrop {
    fn drop(&mut self) {}
}
impl AsyncDrop for HasAsyncDrop {
    async fn drop(self: Pin<&mut Self>) {}
}

struct Holder {
    inner: HasAsyncDrop,
}
async fn bar() {
    Holder {
        inner: HasAsyncDrop
   };
}

Bisects to initial async drop codegen PR 7d65abf

@rustbot label: +S-has-mcve +S-has-bisection +-Zvalidate-mir +requires-incomplete-features -needs-triage

@rustbot rustbot added -Zvalidate-mir Unstable option: MIR validation requires-incomplete-features This issue requires the use of incomplete features. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Zvalidate-mir Unstable option: MIR validation C-bug Category: This is a bug. F-async_drop `#![feature(async_drop)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features This issue requires the use of incomplete features. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants