Closed
Description
#![feature(async_fn_traits)]
#![feature(async_closure)]
#![feature(closure_lifetime_binder)]
#![feature(unboxed_closures)]
#![allow(unused_variables)]
use futures::future::BoxFuture;
use std::{marker::PhantomData, ops::AsyncFnOnce};
pub struct Scope<'scope, 'env: 'scope> {
phantom: PhantomData<&'env &'scope ()>,
}
fn scope_with_closure<'env, B>(_body: B) -> BoxFuture<'env, ()>
where
for<'scope> B: async FnOnce(&'scope Scope<'scope, 'env>),
for<'scope> <B as AsyncFnOnce<(&'scope Scope<'scope, 'scope>,)>>::CallOnceFuture: 'scope,
{
todo!()
}
async fn go<'a>(value: &'a i32) {
scope_with_closure(async |scope| {}).await;
}
fn main() {}
produces
error: internal compiler error: compiler/rustc_middle/src/ty/sty.rs:2234:18: tuple_fields called on non-tuple
thread 'rustc' panicked at compiler/rustc_middle/src/ty/sty.rs:2234:18:
Box<dyn Any>
stack backtrace:
0: 0x7f830e76e885 - std::backtrace_rs::backtrace::libunwind::trace::h781ef2c82f2ceadf
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
1: 0x7f830e76e885 - std::backtrace_rs::backtrace::trace_unsynchronized::he2270efb32be4ab7
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7f830e76e885 - std::sys_common::backtrace::_print_fmt::h96d2a5db7a57d594
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/std/src/sys_common/backtrace.rs:68:5
3: 0x7f830e76e885 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h78bb173879226e7e
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/std/src/sys_common/backtrace.rs:44:22
4: 0x7f830e7bdb4b - core::fmt::rt::Argument::fmt::h2910864bbe475f1a
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/core/src/fmt/rt.rs:142:9
5: 0x7f830e7bdb4b - core::fmt::write::h84af2867d7d195ca
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/core/src/fmt/mod.rs:1153:17
6: 0x7f830e7633ff - std::io::Write::write_fmt::h50f2bab801a3fbad
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/std/src/io/mod.rs:1843:15
7: 0x7f830e76e65e - std::sys_common::backtrace::_print::he2d0ccfbdd723ec0
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/std/src/sys_common/backtrace.rs:47:5
8: 0x7f830e76e65e - std::sys_common::backtrace::print::h5b9583e9ade67c9b
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/std/src/sys_common/backtrace.rs:34:9
9: 0x7f830e771159 - std::panicking::default_hook::{{closure}}::hfcbfda6a0b8af12c
10: 0x7f830e770e75 - std::panicking::default_hook::he4d5c9ef4fcd6b21
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/std/src/panicking.rs:291:9
11: 0x7f8311886e9e - std[413522f2751d2b75]::panicking::update_hook::<alloc[5fd2761cd9155efa]::boxed::Box<rustc_driver_impl[2f7926546870ace]::install_ice_hook::{closure#0}>>::{closure#0}
12: 0x7f830e77185c - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h1ad0011c2cd503ec
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/alloc/src/boxed.rs:2032:9
13: 0x7f830e77185c - std::panicking::rust_panic_with_hook::h75c9fa15c80e870b
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/std/src/panicking.rs:792:13
14: 0x7f83118b6f24 - std[413522f2751d2b75]::panicking::begin_panic::<rustc_errors[51b2cf7f04450880]::ExplicitBug>::{closure#0}
15: 0x7f83118b39c6 - std[413522f2751d2b75]::sys_common::backtrace::__rust_end_short_backtrace::<std[413522f2751d2b75]::panicking::begin_panic<rustc_errors[51b2cf7f04450880]::ExplicitBug>::{closure#0}, !>
16: 0x7f83118aefb6 - std[413522f2751d2b75]::panicking::begin_panic::<rustc_errors[51b2cf7f04450880]::ExplicitBug>
17: 0x7f83118c0321 - <rustc_errors[51b2cf7f04450880]::diagnostic::BugAbort as rustc_errors[51b2cf7f04450880]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
18: 0x7f8311d6bdfc - rustc_middle[15ae3d409dd0b224]::util::bug::opt_span_bug_fmt::<rustc_span[5e74e560d75af342]::span_encoding::Span>::{closure#0}
19: 0x7f8311d5314a - rustc_middle[15ae3d409dd0b224]::ty::context::tls::with_opt::<rustc_middle[15ae3d409dd0b224]::util::bug::opt_span_bug_fmt<rustc_span[5e74e560d75af342]::span_encoding::Span>::{closure#0}, !>::{closure#0}
20: 0x7f8311d52feb - rustc_middle[15ae3d409dd0b224]::ty::context::tls::with_context_opt::<rustc_middle[15ae3d409dd0b224]::ty::context::tls::with_opt<rustc_middle[15ae3d409dd0b224]::util::bug::opt_span_bug_fmt<rustc_span[5e74e560d75af342]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
21: 0x7f830fb1d600 - rustc_middle[15ae3d409dd0b224]::util::bug::bug_fmt
22: 0x7f8311d677c8 - <rustc_middle[15ae3d409dd0b224]::ty::sty::CoroutineClosureSignature>::tupled_upvars_by_closure_kind
23: 0x7f8311d675f0 - <rustc_middle[15ae3d409dd0b224]::ty::sty::CoroutineClosureSignature>::to_coroutine_given_kind_and_upvars
24: 0x7f83123a8bc8 - rustc_trait_selection[34765331fb5ade75]::traits::project::confirm_async_closure_candidate
25: 0x7f831348695d - rustc_trait_selection[34765331fb5ade75]::traits::project::opt_normalize_projection_type
26: 0x7f830f91a41f - <rustc_trait_selection[34765331fb5ade75]::traits::fulfill::FulfillProcessor as rustc_data_structures[1b1503f7eed260f3]::obligation_forest::ObligationProcessor>::process_obligation
27: 0x7f8312bef807 - <rustc_data_structures[1b1503f7eed260f3]::obligation_forest::ObligationForest<rustc_trait_selection[34765331fb5ade75]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[34765331fb5ade75]::traits::fulfill::FulfillProcessor>
28: 0x7f8312c30371 - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::resolve_vars_with_obligations
29: 0x7f8313456917 - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_argument_types
30: 0x7f831344c4b7 - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_call
31: 0x7f83133c6fdd - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
32: 0x7f83133adf1a - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_match
33: 0x7f83133c8757 - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
34: 0x7f83133c18a6 - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_block_with_expected
35: 0x7f83133c74c1 - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
36: 0x7f83133c8eca - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
37: 0x7f83133c195d - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_block_with_expected
38: 0x7f83133c74c1 - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
39: 0x7f8313399fcf - rustc_hir_typeck[aeb4cccfffa71a21]::check::check_fn
40: 0x7f831334fde4 - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_expr_closure
41: 0x7f83133c9ef2 - <rustc_hir_typeck[aeb4cccfffa71a21]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
42: 0x7f8313399fcf - rustc_hir_typeck[aeb4cccfffa71a21]::check::check_fn
43: 0x7f831338ffca - rustc_hir_typeck[aeb4cccfffa71a21]::typeck
44: 0x7f831338f98b - rustc_query_impl[81fadc7a5ce9f403]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[81fadc7a5ce9f403]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 8usize]>>
45: 0x7f8312eacb31 - rustc_query_system[8deeeada26003c6a]::query::plumbing::try_execute_query::<rustc_query_impl[81fadc7a5ce9f403]::DynamicConfig<rustc_query_system[8deeeada26003c6a]::query::caches::VecCache<rustc_span[5e74e560d75af342]::def_id::LocalDefId, rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[81fadc7a5ce9f403]::plumbing::QueryCtxt, false>
46: 0x7f8312ea8a4c - rustc_query_impl[81fadc7a5ce9f403]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
47: 0x7f83131f0944 - rustc_middle[15ae3d409dd0b224]::query::plumbing::query_get_at::<rustc_query_system[8deeeada26003c6a]::query::caches::VecCache<rustc_span[5e74e560d75af342]::def_id::LocalDefId, rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 8usize]>>>
48: 0x7f8313a2e898 - rustc_hir_analysis[7d5ccaa90f6e7d51]::collect::type_of::type_of_opaque
49: 0x7f8313a2e7ef - rustc_query_impl[81fadc7a5ce9f403]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[81fadc7a5ce9f403]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 8usize]>>
50: 0x7f8312cdb121 - rustc_query_system[8deeeada26003c6a]::query::plumbing::try_execute_query::<rustc_query_impl[81fadc7a5ce9f403]::DynamicConfig<rustc_query_system[8deeeada26003c6a]::query::caches::DefIdCache<rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[81fadc7a5ce9f403]::plumbing::QueryCtxt, false>
51: 0x7f8313c044de - rustc_query_impl[81fadc7a5ce9f403]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
52: 0x7f83131e4cfe - rustc_middle[15ae3d409dd0b224]::query::plumbing::query_get_at::<rustc_query_system[8deeeada26003c6a]::query::caches::DefIdCache<rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 8usize]>>>
53: 0x7f8310956c39 - rustc_hir_analysis[7d5ccaa90f6e7d51]::collect::type_of::type_of
54: 0x7f8312cdc4e2 - rustc_query_impl[81fadc7a5ce9f403]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[81fadc7a5ce9f403]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 8usize]>>
55: 0x7f8312cdb121 - rustc_query_system[8deeeada26003c6a]::query::plumbing::try_execute_query::<rustc_query_impl[81fadc7a5ce9f403]::DynamicConfig<rustc_query_system[8deeeada26003c6a]::query::caches::DefIdCache<rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[81fadc7a5ce9f403]::plumbing::QueryCtxt, false>
56: 0x7f8312cdac1b - rustc_query_impl[81fadc7a5ce9f403]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
57: 0x7f83131e4cfe - rustc_middle[15ae3d409dd0b224]::query::plumbing::query_get_at::<rustc_query_system[8deeeada26003c6a]::query::caches::DefIdCache<rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 8usize]>>>
58: 0x7f83137671eb - rustc_hir_analysis[7d5ccaa90f6e7d51]::check::check::check_item_type
59: 0x7f83137565aa - rustc_hir_analysis[7d5ccaa90f6e7d51]::check::wfcheck::check_well_formed
60: 0x7f8313754de3 - rustc_query_impl[81fadc7a5ce9f403]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[81fadc7a5ce9f403]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 1usize]>>
61: 0x7f8313754580 - rustc_query_system[8deeeada26003c6a]::query::plumbing::try_execute_query::<rustc_query_impl[81fadc7a5ce9f403]::DynamicConfig<rustc_query_system[8deeeada26003c6a]::query::caches::VecCache<rustc_hir[1fa864fd1f47110f]::hir_id::OwnerId, rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[81fadc7a5ce9f403]::plumbing::QueryCtxt, false>
62: 0x7f83137542ff - rustc_query_impl[81fadc7a5ce9f403]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
63: 0x7f8313752241 - rustc_hir_analysis[7d5ccaa90f6e7d51]::check::wfcheck::check_mod_type_wf
64: 0x7f8313752089 - rustc_query_impl[81fadc7a5ce9f403]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[81fadc7a5ce9f403]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 1usize]>>
65: 0x7f83136913c6 - rustc_query_system[8deeeada26003c6a]::query::plumbing::try_execute_query::<rustc_query_impl[81fadc7a5ce9f403]::DynamicConfig<rustc_query_system[8deeeada26003c6a]::query::caches::DefaultCache<rustc_span[5e74e560d75af342]::def_id::LocalModDefId, rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[81fadc7a5ce9f403]::plumbing::QueryCtxt, false>
66: 0x7f831369117f - rustc_query_impl[81fadc7a5ce9f403]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
67: 0x7f8312ea6d0f - rustc_hir_analysis[7d5ccaa90f6e7d51]::check_crate
68: 0x7f8312ebacea - rustc_interface[a3202ac2833931cb]::passes::analysis
69: 0x7f8312eba847 - rustc_query_impl[81fadc7a5ce9f403]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[81fadc7a5ce9f403]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 1usize]>>
70: 0x7f8313a78965 - rustc_query_system[8deeeada26003c6a]::query::plumbing::try_execute_query::<rustc_query_impl[81fadc7a5ce9f403]::DynamicConfig<rustc_query_system[8deeeada26003c6a]::query::caches::SingleCache<rustc_middle[15ae3d409dd0b224]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[81fadc7a5ce9f403]::plumbing::QueryCtxt, false>
71: 0x7f8313a786c9 - rustc_query_impl[81fadc7a5ce9f403]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
72: 0x7f83139138d4 - rustc_interface[a3202ac2833931cb]::interface::run_compiler::<core[87b6336991ca90c4]::result::Result<(), rustc_span[5e74e560d75af342]::ErrorGuaranteed>, rustc_driver_impl[2f7926546870ace]::run_compiler::{closure#0}>::{closure#0}
73: 0x7f83139ebaff - std[413522f2751d2b75]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[a3202ac2833931cb]::util::run_in_thread_with_globals<rustc_interface[a3202ac2833931cb]::util::run_in_thread_pool_with_globals<rustc_interface[a3202ac2833931cb]::interface::run_compiler<core[87b6336991ca90c4]::result::Result<(), rustc_span[5e74e560d75af342]::ErrorGuaranteed>, rustc_driver_impl[2f7926546870ace]::run_compiler::{closure#0}>::{closure#0}, core[87b6336991ca90c4]::result::Result<(), rustc_span[5e74e560d75af342]::ErrorGuaranteed>>::{closure#0}, core[87b6336991ca90c4]::result::Result<(), rustc_span[5e74e560d75af342]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[87b6336991ca90c4]::result::Result<(), rustc_span[5e74e560d75af342]::ErrorGuaranteed>>
74: 0x7f83139eb8f4 - <<std[413522f2751d2b75]::thread::Builder>::spawn_unchecked_<rustc_interface[a3202ac2833931cb]::util::run_in_thread_with_globals<rustc_interface[a3202ac2833931cb]::util::run_in_thread_pool_with_globals<rustc_interface[a3202ac2833931cb]::interface::run_compiler<core[87b6336991ca90c4]::result::Result<(), rustc_span[5e74e560d75af342]::ErrorGuaranteed>, rustc_driver_impl[2f7926546870ace]::run_compiler::{closure#0}>::{closure#0}, core[87b6336991ca90c4]::result::Result<(), rustc_span[5e74e560d75af342]::ErrorGuaranteed>>::{closure#0}, core[87b6336991ca90c4]::result::Result<(), rustc_span[5e74e560d75af342]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[87b6336991ca90c4]::result::Result<(), rustc_span[5e74e560d75af342]::ErrorGuaranteed>>::{closure#1} as core[87b6336991ca90c4]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
75: 0x7f830e77b28b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2f5474486ca83df6
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/alloc/src/boxed.rs:2018:9
76: 0x7f830e77b28b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc79a9a7fbf859b03
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/alloc/src/boxed.rs:2018:9
77: 0x7f830e77b28b - std::sys::pal::unix::thread::Thread::new::thread_start::h4fb19c8183188eaa
at /rustc/ab5bda1aa70f707014e2e691e43bc37a8819252a/library/std/src/sys/pal/unix/thread.rs:108:17
78: 0x7f830e688609 - start_thread
79: 0x7f830e5ab353 - clone
80: 0x0 - <unknown>
note: it seems that this compiler `1.79.0-nightly (ab5bda1aa 2024-04-08)` is outdated, a newer nightly should have been released in the meantime
|
= note: please consider running `rustup update nightly` to update the nightly channel and check if this problem still persists
= note: if the problem still persists, 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 attach the file at `/playground/rustc-ice-2024-04-09T21_35_22-23.txt` to your bug report
note: compiler flags: --crate-type bin -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [typeck] type-checking `go`
#1 [type_of_opaque] computing type of opaque `go::{opaque#0}`
#2 [type_of] computing type of `go::{opaque#0}`
#3 [check_well_formed] checking that `go::{opaque#0}` is well-formed
#4 [check_mod_type_wf] checking that types are well-formed in top-level module
#5 [analysis] running analysis passes on this crate
end of query stack