rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
93.58k stars 12.05k forks source link

ICE: Async Gen Closures #124751

Open veera-sivarajan opened 1 week ago

veera-sivarajan commented 1 week ago

Code

#![feature(gen_blocks)]

fn main() {
    let _ = async gen || {};
}

Meta

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

Backtrace

``` 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 - ::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 - 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:: 14: 0x7faa84083102 - ::lower_expr_coroutine_closure 15: 0x7faa8407f4fa - ::lower_expr_mut::{closure#0} 16: 0x7faa8407c576 - ::lower_stmts 17: 0x7faa8407c27b - ::lower_block 18: 0x7faa8408c8e6 - ::lower_block_expr_opt 19: 0x7faa8405758f - ::lower_fn_body::<::lower_fn_body_block::{closure#0}> 20: 0x7faa8408ca2b - ::lower_maybe_coroutine_body 21: 0x7faa84058ed0 - ::with_new_scopes::::lower_item_kind::{closure#1}> 22: 0x7faa84089b6f - ::lower_item 23: 0x7faa8406c733 - ::with_hir_id_owner::<::with_lctx<::lower_item::{closure#0}>::{closure#0}> 24: 0x7faa840b8684 - ::with_lctx::<::lower_item::{closure#0}> 25: 0x7faa840bb9bf - ::lower_node 26: 0x7faa840920f9 - rustc_ast_lowering[5c0c0671e07de916]::lower_to_hir 27: 0x7faa84891f46 - rustc_query_impl[efd99a9a4001822]::plumbing::__rust_begin_short_backtrace::> 28: 0x7faa846367e9 - >::call_once 29: 0x7faa84564fa7 - >>::with::>, 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::>, 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 - >::call_once 33: 0x7faa84891dc9 - rustc_query_impl[efd99a9a4001822]::plumbing::__rust_begin_short_backtrace::> 34: 0x7faa84804e8c - >::call_once 35: 0x7faa845682ce - >>::with::>, 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::>, 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 - ::attrs 39: 0x7faa843a52cf - rustc_passes[827c2f259c8e8167]::entry::entry_fn 40: 0x7faa84891533 - rustc_query_impl[efd99a9a4001822]::plumbing::__rust_begin_short_backtrace::> 41: 0x7faa846220fd - >::call_once 42: 0x7faa8456503e - >>::with::>, 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::>, 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 - ::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> 47: 0x7faa832f8fec - ::run::<(), rustc_interface[9a3e0f1c28247fb]::passes::run_required_analyses::{closure#0}::{closure#0}::{closure#0}> 48: 0x7faa8326e632 - ::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::> 51: 0x7faa84815dc9 - >::call_once 52: 0x7faa84564e87 - >>::with::>, 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::>, 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 - >>::with::::enter>::{closure#1}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>>::{closure#0}, core[8f9a0d34630653c0]::result::Result<(), rustc_span[5de32988c3388e42]::ErrorGuaranteed>> 56: 0x7faa830ca746 - ::enter::> 57: 0x7faa830607a3 - ::enter::, rustc_span[5de32988c3388e42]::ErrorGuaranteed>> 58: 0x7faa830fea57 - >::set::, 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::, rustc_interface[9a3e0f1c28247fb]::util::run_in_thread_with_globals, 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_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]::panic::unwind_safe::AssertUnwindSafe<::spawn_unchecked_, 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 - <::spawn_unchecked_, 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 - as core::ops::function::FnOnce>::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 - 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 ```

veera-sivarajan commented 1 week ago

@rustbot label +F-gen_blocks +requires-nightly -needs-triage