Repository: rust
Issue: ICE: Async Gen Closures
Labels: I-ICE,T-compiler,C-bug,requires-nightly,S-bug-has-test,F-gen_blocks

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->

### Code

```Rust
#![feature(gen_blocks)]

fn main() {
    let _ = async gen || {};
}
```


### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.80.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.80.0-dev
LLVM version: 18.1.4
```

### Bisects To
#120361 

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```
thread 'rustc' panicked at compiler/rustc_ast_lowering/src/expr.rs:1070:9:
assertion `left matches right` failed: only async closures are supported currently
  left: AsyncGen { span: test.rs:9:13: 9:22 (#0), closure_id: NodeId(15), return_impl_trait_id: NodeId(16) }
 right: CoroutineKind::Async { .. }
stack backtrace:
   0:     0x7faa82543216 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc2ad577dc1b6821e
   1:     0x7faa825cad4b - core::fmt::write::h9e0aa8528f9e7a96
   2:     0x7faa82553b59 - std::io::Write::write_fmt::hfccb98e06608571a
   3:     0x7faa8254304f - std::sys_common::backtrace::print::h9fd646b9fcaac333
   4:     0x7faa8255c359 - std::panicking::default_hook::{{closure}}::h8196424f119ab9a6
   5:     0x7faa8255c117 - std::panicking::default_hook::he75f39a8bfa68d05
   6:     0x7faa830ebfd9 - <alloc[e6bc8ffa843b0e0b]::boxed::Box<rustc_driver_impl[9c855668c28d8d3b]::install_ice_hook::{closure#0}> as core[8f9a0d34630653c0]::ops::function::Fn<(&dyn for<'a, 'b> core[8f9a0d34630653c0]::ops::function::Fn<(&'a core[8f9a0d34630653c0]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[8f9a0d34630653c0]::marker::Send + core[8f9a0d34630653c0]::marker::Sync, &core[8f9a0d34630653c0]::panic::panic_info::PanicInfo)>>::call
   7:     0x7faa8255c82e - std::panicking::rust_panic_with_hook::h06f1513f2c335868
   8:     0x7faa8256a12e - std::panicking::begin_panic_handler::{{closure}}::hba3fa956fa651055
   9:     0x7faa8256a059 - std::sys_common::backtrace::__rust_end_short_backtrace::hc48b82a32c1361ed
  10:     0x7faa8255c429 - rust_begin_unwind
  11:     0x7faa825321b3 - core::panicking::panic_fmt::h89562522261c833a
  12:     0x7faa8253264f - core::panicking::assert_failed_inner::hf40a98fb5f423830
  13:     0x7faa82eb9d8c - core[8f9a0d34630653c0]::panicking::assert_matches_failed::<rustc_ast[4316ec2cf1b6d1f2]::ast::CoroutineKind>
  14:     0x7faa84083102 - <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::lower_expr_coroutine_closure
  15:     0x7faa8407f4fa - <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::lower_expr_mut::{closure#0}
  16:     0x7faa8407c576 - <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::lower_stmts
  17:     0x7faa8407c27b - <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::lower_block
  18:     0x7faa8408c8e6 - <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::lower_block_expr_opt
  19:     0x7faa8405758f - <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::lower_fn_body::<<rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::lower_fn_body_block::{closure#0}>
  20:     0x7faa8408ca2b - <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::lower_maybe_coroutine_body
  21:     0x7faa84058ed0 - <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::with_new_scopes::<rustc_hir[e90a0ed907b6549a]::hir::ItemKind, <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::lower_item_kind::{closure#1}>
  22:     0x7faa84089b6f - <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::lower_item
  23:     0x7faa8406c733 - <rustc_ast_lowering[5c0c0671e07de916]::LoweringContext>::with_hir_id_owner::<<rustc_ast_lowering[5c0c0671e07de916]::item::ItemLowerer>::with_lctx<<rustc_ast_lowering[5c0c0671e07de916]::item::ItemLowerer>::lower_item::{closure#0}>::{closure#0}>
  24:     0x7faa840b8684 - <rustc_ast_lowering[5c0c0671e07de916]::item::ItemLowerer>::with_lctx::<<rustc_ast_lowering[5c0c0671e07de916]::item::ItemLowerer>::lower_item::{closure#0}>
  25:     0x7faa840bb9bf - <rustc_ast_lowering[5c0c0671e07de916]::item::ItemLowerer>::lower_node
  26:     0x7faa840920f9 - rustc_ast_lowering[5c0c0671e07de916]::lower_to_hir
  27:     0x7faa84891f46 - rustc_query_impl[efd99a9a4001822]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[efd99a9a4001822]::query_impl::hir_crate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 8usize]>>
  28:     0x7faa846367e9 - <rustc_query_impl[efd99a9a4001822]::query_impl::hir_crate::dynamic_query::{closure#2} as core[8f9a0d34630653c0]::ops::function::FnOnce<(rustc_middle[925c171ccec961ea]::ty::context::TyCtxt, ())>>::call_once
  29:     0x7faa84564fa7 - <std[afc5627afab9b6c]::thread::local::LocalKey<core[8f9a0d34630653c0]::cell::Cell<*const ()>>>::with::<rustc_middle[925c171ccec961ea]::ty::context::tls::enter_context<rustc_query_system[b6250073b875db0f]::query::plumbing::execute_job_non_incr<rustc_query_impl[efd99a9a4001822]::DynamicConfig<rustc_query_system[b6250073b875db0f]::query::caches::SingleCache<rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[efd99a9a4001822]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 8usize]>>
  30:     0x7faa84795daa - rustc_query_system[b6250073b875db0f]::query::plumbing::try_execute_query::<rustc_query_impl[efd99a9a4001822]::DynamicConfig<rustc_query_system[b6250073b875db0f]::query::caches::SingleCache<rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[efd99a9a4001822]::plumbing::QueryCtxt, false>
  31:     0x7faa8489408b - rustc_query_impl[efd99a9a4001822]::query_impl::hir_crate::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7faa857dd408 - <rustc_middle[925c171ccec961ea]::hir::provide::{closure#3} as core[8f9a0d34630653c0]::ops::function::FnOnce<(rustc_middle[925c171ccec961ea]::ty::context::TyCtxt, rustc_hir[e90a0ed907b6549a]::hir_id::OwnerId)>>::call_once
  33:     0x7faa84891dc9 - rustc_query_impl[efd99a9a4001822]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[efd99a9a4001822]::query_impl::hir_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 8usize]>>
  34:     0x7faa84804e8c - <rustc_query_impl[efd99a9a4001822]::query_impl::hir_attrs::dynamic_query::{closure#2} as core[8f9a0d34630653c0]::ops::function::FnOnce<(rustc_middle[925c171ccec961ea]::ty::context::TyCtxt, rustc_hir[e90a0ed907b6549a]::hir_id::OwnerId)>>::call_once
  35:     0x7faa845682ce - <std[afc5627afab9b6c]::thread::local::LocalKey<core[8f9a0d34630653c0]::cell::Cell<*const ()>>>::with::<rustc_middle[925c171ccec961ea]::ty::context::tls::enter_context<rustc_query_system[b6250073b875db0f]::query::plumbing::execute_job_non_incr<rustc_query_impl[efd99a9a4001822]::DynamicConfig<rustc_query_system[b6250073b875db0f]::query::caches::VecCache<rustc_hir[e90a0ed907b6549a]::hir_id::OwnerId, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[efd99a9a4001822]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 8usize]>>
  36:     0x7faa847ffa8c - rustc_query_system[b6250073b875db0f]::query::plumbing::try_execute_query::<rustc_query_impl[efd99a9a4001822]::DynamicConfig<rustc_query_system[b6250073b875db0f]::query::caches::VecCache<rustc_hir[e90a0ed907b6549a]::hir_id::OwnerId, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[efd99a9a4001822]::plumbing::QueryCtxt, false>
  37:     0x7faa84635c76 - rustc_query_impl[efd99a9a4001822]::query_impl::hir_attrs::get_query_non_incr::__rust_end_short_backtrace
  38:     0x7faa858320aa - <rustc_middle[925c171ccec961ea]::hir::map::Map>::attrs
  39:     0x7faa843a52cf - rustc_passes[827c2f259c8e8167]::entry::entry_fn
  40:     0x7faa84891533 - rustc_query_impl[efd99a9a4001822]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[efd99a9a4001822]::query_impl::entry_fn::dynamic_query::{closure#2}::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 12usize]>>
  41:     0x7faa846220fd - <rustc_query_impl[efd99a9a4001822]::query_impl::entry_fn::dynamic_query::{closure#2} as core[8f9a0d34630653c0]::ops::function::FnOnce<(rustc_middle[925c171ccec961ea]::ty::context::TyCtxt, ())>>::call_once
  42:     0x7faa8456503e - <std[afc5627afab9b6c]::thread::local::LocalKey<core[8f9a0d34630653c0]::cell::Cell<*const ()>>>::with::<rustc_middle[925c171ccec961ea]::ty::context::tls::enter_context<rustc_query_system[b6250073b875db0f]::query::plumbing::execute_job_non_incr<rustc_query_impl[efd99a9a4001822]::DynamicConfig<rustc_query_system[b6250073b875db0f]::query::caches::SingleCache<rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 12usize]>>, false, false, false>, rustc_query_impl[efd99a9a4001822]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 12usize]>>::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 12usize]>>
  43:     0x7faa84796f6d - rustc_query_system[b6250073b875db0f]::query::plumbing::try_execute_query::<rustc_query_impl[efd99a9a4001822]::DynamicConfig<rustc_query_system[b6250073b875db0f]::query::caches::SingleCache<rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 12usize]>>, false, false, false>, rustc_query_impl[efd99a9a4001822]::plumbing::QueryCtxt, false>
  44:     0x7faa8462291b - rustc_query_impl[efd99a9a4001822]::query_impl::entry_fn::get_query_non_incr::__rust_end_short_backtrace
  45:     0x7faa8326df41 - <rustc_session[a2499ec62cb1d9b8]::session::Session>::time::<(), rustc_interface[9a3e0f1c28247fb]::passes::run_required_analyses::{closure#0}::{closure#0}::{closure#0}::{closure#0}>
  46:     0x7faa8331a605 - std[afc5627afab9b6c]::panicking::try::<(), core[8f9a0d34630653c0]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[9a3e0f1c28247fb]::passes::run_required_analyses::{closure#0}::{closure#0}::{closure#0}>>
  47:     0x7faa832f8fec - <rustc_data_structures[5bcea33e1f4ea30c]::sync::parallel::ParallelGuard>::run::<(), rustc_interface[9a3e0f1c28247fb]::passes::run_required_analyses::{closure#0}::{closure#0}::{closure#0}>
  48:     0x7faa8326e632 - <rustc_session[a2499ec62cb1d9b8]::session::Session>::time::<(), rustc_interface[9a3e0f1c28247fb]::passes::run_required_analyses::{closure#0}>
  49:     0x7faa8329dca3 - rustc_interface[9a3e0f1c28247fb]::passes::analysis
  50:     0x7faa84890f47 - rustc_query_impl[efd99a9a4001822]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[efd99a9a4001822]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 1usize]>>
  51:     0x7faa84815dc9 - <rustc_query_impl[efd99a9a4001822]::query_impl::analysis::dynamic_query::{closure#2} as core[8f9a0d34630653c0]::ops::function::FnOnce<(rustc_middle[925c171ccec961ea]::ty::context::TyCtxt, ())>>::call_once
  52:     0x7faa84564e87 - <std[afc5627afab9b6c]::thread::local::LocalKey<core[8f9a0d34630653c0]::cell::Cell<*const ()>>>::with::<rustc_middle[925c171ccec961ea]::ty::context::tls::enter_context<rustc_query_system[b6250073b875db0f]::query::plumbing::execute_job_non_incr<rustc_query_impl[efd99a9a4001822]::DynamicConfig<rustc_query_system[b6250073b875db0f]::query::caches::SingleCache<rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[efd99a9a4001822]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 1usize]>>::{closure#0}, rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 1usize]>>
  53:     0x7faa84793ab1 - rustc_query_system[b6250073b875db0f]::query::plumbing::try_execute_query::<rustc_query_impl[efd99a9a4001822]::DynamicConfig<rustc_query_system[b6250073b875db0f]::query::caches::SingleCache<rustc_middle[925c171ccec961ea]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[efd99a9a4001822]::plumbing::QueryCtxt, false>
  54:     0x7faa84523f62 - rustc_query_impl[efd99a9a4001822]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  55:     0x7faa8307ab90 - <std[afc5627afab9b6c]::thread::local::LocalKey<core[8f9a0d34630653c0]::cell::Cell<*const ()>>>::with::<rustc_middle[925c171ccec961ea]::ty::context::tls::enter_context<<rustc_middle[925c171ccec961ea]::ty::context::GlobalCtxt>::enter<rustc_driver_impl[9c855668c28d8d3b]::run_compiler::{closure#0}::{closure#1}::{closure#3}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#1}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>
  56:     0x7faa830ca746 - <rustc_middle[925c171ccec961ea]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[9c855668c28d8d3b]::run_compiler::{closure#0}::{closure#1}::{closure#3}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>
  57:     0x7faa830607a3 - <rustc_interface[9a3e0f1c28247fb]::interface::Compiler>::enter::<rustc_driver_impl[9c855668c28d8d3b]::run_compiler::{closure#0}::{closure#1}, core[8f9a0d34630653c0]::result::Result<core[8f9a0d34630653c0]::option::Option<rustc_interface[9a3e0f1c28247fb]::queries::Linker>, rustc_span[5de32988c3388e42]::ErrorGuaranteed>>
  58:     0x7faa830fea57 - <scoped_tls[8df7d912cec66977]::ScopedKey<rustc_span[5de32988c3388e42]::SessionGlobals>>::set::<rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_with_globals<rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_pool_with_globals<rustc_interface[9a3e0f1c28247fb]::interface::run_compiler<core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>, rustc_driver_impl[9c855668c28d8d3b]::run_compiler::{closure#0}>::{closure#1}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>
  59:     0x7faa83070bb5 - rustc_span[5de32988c3388e42]::create_session_globals_then::<core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>, rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_with_globals<rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_pool_with_globals<rustc_interface[9a3e0f1c28247fb]::interface::run_compiler<core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>, rustc_driver_impl[9c855668c28d8d3b]::run_compiler::{closure#0}>::{closure#1}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
  60:     0x7faa830e5f26 - std[afc5627afab9b6c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_with_globals<rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_pool_with_globals<rustc_interface[9a3e0f1c28247fb]::interface::run_compiler<core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>, rustc_driver_impl[9c855668c28d8d3b]::run_compiler::{closure#0}>::{closure#1}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>
  61:     0x7faa830c5cc1 - std[afc5627afab9b6c]::panicking::try::<core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>, core[8f9a0d34630653c0]::panic::unwind_safe::AssertUnwindSafe<<std[afc5627afab9b6c]::thread::Builder>::spawn_unchecked_<rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_with_globals<rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_pool_with_globals<rustc_interface[9a3e0f1c28247fb]::interface::run_compiler<core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>, rustc_driver_impl[9c855668c28d8d3b]::run_compiler::{closure#0}>::{closure#1}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#2}::{closure#0}>>
  62:     0x7faa83109785 - <<std[afc5627afab9b6c]::thread::Builder>::spawn_unchecked_<rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_with_globals<rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_pool_with_globals<rustc_interface[9a3e0f1c28247fb]::interface::run_compiler<core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>, rustc_driver_impl[9c855668c28d8d3b]::run_compiler::{closure#0}>::{closure#1}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#2} as core[8f9a0d34630653c0]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  63:     0x7faa8253672d - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7a7a3823a5cfefcd
  64:     0x7faa825798da - std::sys::pal::unix::thread::Thread::new::thread_start::h4edf7802148ea1bf
  65:     0x7faa8232eac3 - start_thread
                               at ./nptl/pthread_create.c:442:8
  66:     0x7faa823c0850 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  67:                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/veera/projects/rust/rustc-ice-2024-05-05T14_03_30-983035.txt` to your bug report

note: compiler flags: -Z unstable-options -Z track-diagnostics

query stack during panic:
#0 [hir_crate] getting the crate HIR
#1 [hir_attrs] getting HIR owner attributes in ``
#2 [entry_fn] looking up the entry function of a crate
#3 [analysis] running analysis passes on this crate
end of query stack

```

</p>
</details>