Skip to content
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

Rust compiler unexpected panic on 1.62.0-nightly #96598

Closed
brkydnc opened this issue May 1, 2022 · 5 comments
Closed

Rust compiler unexpected panic on 1.62.0-nightly #96598

brkydnc opened this issue May 1, 2022 · 5 comments
Labels
C-bug Category: This is a bug. 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.

Comments

@brkydnc
Copy link

brkydnc commented May 1, 2022

Code

impl Guest {
    async fn handle(
        guest_client: Client, 
        host_client: &mut Client,
        result: ClientListenResult,
        host: &mut Member<Self>,
        guest: &mut Member<Guest>)
    {
        // omit
    }
}

impl Lobby {
    async fn listen(mut self, mut receiver: Receiver<Client>) {
        while let ClientListenerState::Listen(mut host_client) = self.host.listener.take() {
            let guest_listen_future: OptionFuture<_> = self.guest.listener
                .client()
                .map(|client| client.move_listen())
                .into();
            
            select! {
                result = host_client.listen() => {
                    Host::handle(host_client, result, &mut self.host, &mut self.guest).await;
                }
                Some((result, guest_client)) = guest_listen_future => {
                    Guest::handle(guest_client, result, &mut self.host, &mut self.guest).await;
                }
            }
        }
    }
}

Meta

rustc --version --verbose:

rustc 1.62.0-nightly (e85edd9a8 2022-04-28)
binary: rustc
commit-hash: e85edd9a844b523a02dbd89f3c02cd13e4c9fe46
commit-date: 2022-04-28
host: x86_64-unknown-linux-gnu
release: 1.62.0-nightly
LLVM version: 14.0.1

Error output

thread 'rustc' panicked at 'index out of bounds: the len is 4 but the index is 4', compiler/rustc_typeck/src/check/fn_ctxt/checks.rs:432:35
stack backtrace:
   0:     0x7fd6d689df8d - std::backtrace_rs::backtrace::libunwind::trace::he0e523aecaf9b69a
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fd6d689df8d - std::backtrace_rs::backtrace::trace_unsynchronized::h0b3d5356c458deb9
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd6d689df8d - std::sys_common::backtrace::_print_fmt::h532142ee1f4c3cce
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fd6d689df8d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0e80dc5906b67229
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fd6d68f9d0c - core::fmt::write::h513fcc964bdd71c0
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/core/src/fmt/mod.rs:1194:17
   5:     0x7fd6d688f681 - std::io::Write::write_fmt::h3cddf21fb8a62a54
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/io/mod.rs:1655:15
   6:     0x7fd6d68a0ca5 - std::sys_common::backtrace::_print::h0c926e8785159afb
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fd6d68a0ca5 - std::sys_common::backtrace::print::hd5783f5f7c42c4da
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fd6d68a0ca5 - std::panicking::default_hook::{{closure}}::h315d25e8d5d703cd
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/panicking.rs:295:22
   9:     0x7fd6d68a0919 - std::panicking::default_hook::h4301451e8ab677e5
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/panicking.rs:314:9
  10:     0x7fd6d70d0981 - rustc_driver[7ec1e2549f75ff84]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fd6c30f4273 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h7852e00f97258d25
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/alloc/src/boxed.rs:1880:9
  12:     0x7fd6c30f322d - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h65928c3d44bdbc45
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/proc_macro/src/bridge/client.rs:335:21
  13:     0x7fd6d68a1476 - std::panicking::rust_panic_with_hook::h9ade200275992b5b
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/panicking.rs:702:17
  14:     0x7fd6d68a1277 - std::panicking::begin_panic_handler::{{closure}}::h3460cd0d1874a7f9
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/panicking.rs:588:13
  15:     0x7fd6d689e444 - std::sys_common::backtrace::__rust_end_short_backtrace::h01570b830acaf147
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/sys_common/backtrace.rs:138:18
  16:     0x7fd6d68a0fa9 - rust_begin_unwind
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/panicking.rs:584:5
  17:     0x7fd6d68662c3 - core::panicking::panic_fmt::h188393b449504c74
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/core/src/panicking.rs:142:14
  18:     0x7fd6d6866202 - core::panicking::panic_bounds_check::hf0a31540c7c456de
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/core/src/panicking.rs:84:5
  19:     0x7fd6d745ad44 - <alloc[af6f502ea7079f55]::vec::drain_filter::DrainFilter<rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::arg_matrix::Error, <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_argument_types::{closure#4}> as core[649e541f68e0944c]::ops::drop::Drop>::drop
  20:     0x7fd6d8572568 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_argument_types
  21:     0x7fd6d853fd0e - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::confirm_builtin_call
  22:     0x7fd6d853c178 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_call
  23:     0x7fd6d85918de - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  24:     0x7fd6d855595f - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_argument_types
  25:     0x7fd6d853fd0e - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::confirm_builtin_call
  26:     0x7fd6d853c178 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_call
  27:     0x7fd6d85918de - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  28:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  29:     0x7fd6d939a3f3 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::demand_scrutinee_type
  30:     0x7fd6d858cd65 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_match
  31:     0x7fd6d8592140 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  32:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  33:     0x7fd6d857e899 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_stmt
  34:     0x7fd6d857ff10 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  35:     0x7fd6d8591a03 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  36:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  37:     0x7fd6d858d049 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_match
  38:     0x7fd6d8592140 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  39:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  40:     0x7fd6d857ff4b - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  41:     0x7fd6d8591a03 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  42:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  43:     0x7fd6d857ff4b - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  44:     0x7fd6d8591a03 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  45:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  46:     0x7fd6d8592b70 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  47:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  48:     0x7fd6d857ff4b - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  49:     0x7fd6d8594164 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  50:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  51:     0x7fd6d857f5fd - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_stmt
  52:     0x7fd6d8580634 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  53:     0x7fd6d8591a03 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  54:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  55:     0x7fd6d8592ef1 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  56:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  57:     0x7fd6d857ff4b - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  58:     0x7fd6d8591a03 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  59:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  60:     0x7fd6d85bc326 - rustc_typeck[1151d2025d9ba668]::check::check::check_fn
  61:     0x7fd6d858f473 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_closure
  62:     0x7fd6d8593763 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  63:     0x7fd6d855595f - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_argument_types
  64:     0x7fd6d853fd0e - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::confirm_builtin_call
  65:     0x7fd6d853c178 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_call
  66:     0x7fd6d85918de - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_kind
  67:     0x7fd6d8590720 - <rustc_typeck[1151d2025d9ba668]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  68:     0x7fd6d85bc326 - rustc_typeck[1151d2025d9ba668]::check::check::check_fn
  69:     0x7fd6d861a2cd - <rustc_infer[e19efdb6491ce65]::infer::InferCtxtBuilder>::enter::<&rustc_middle[ca61dcd531efc7c8]::ty::context::TypeckResults, <rustc_typeck[1151d2025d9ba668]::check::inherited::InheritedBuilder>::enter<rustc_typeck[1151d2025d9ba668]::check::typeck_with_fallback<rustc_typeck[1151d2025d9ba668]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[ca61dcd531efc7c8]::ty::context::TypeckResults>::{closure#0}>
  70:     0x7fd6d85ce9f0 - rustc_typeck[1151d2025d9ba668]::check::typeck
  71:     0x7fd6d96ca780 - <rustc_query_system[41100cafef1fb88d]::dep_graph::graph::DepGraph<rustc_middle[ca61dcd531efc7c8]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[ca61dcd531efc7c8]::ty::context::TyCtxt, rustc_span[c6bedfd0c66fb146]::def_id::LocalDefId, &rustc_middle[ca61dcd531efc7c8]::ty::context::TypeckResults>
  72:     0x7fd6d8af82f6 - rustc_query_system[41100cafef1fb88d]::query::plumbing::try_execute_query::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt, rustc_query_system[41100cafef1fb88d]::query::caches::DefaultCache<rustc_span[c6bedfd0c66fb146]::def_id::LocalDefId, &rustc_middle[ca61dcd531efc7c8]::ty::context::TypeckResults>>
  73:     0x7fd6d95d0631 - rustc_query_system[41100cafef1fb88d]::query::plumbing::force_query::<rustc_query_impl[46a3cb9608bcfa63]::queries::typeck, rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt>
  74:     0x7fd6d9710e7e - rustc_query_impl[46a3cb9608bcfa63]::query_callbacks::typeck::force_from_dep_node
  75:     0x7fd6d8fdd941 - <rustc_middle[ca61dcd531efc7c8]::ty::context::TyCtxt as rustc_query_system[41100cafef1fb88d]::dep_graph::DepContext>::try_force_from_dep_node
  76:     0x7fd6d8baca5e - <rustc_query_system[41100cafef1fb88d]::dep_graph::graph::DepGraph<rustc_middle[ca61dcd531efc7c8]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt>
  77:     0x7fd6d8baca2c - <rustc_query_system[41100cafef1fb88d]::dep_graph::graph::DepGraph<rustc_middle[ca61dcd531efc7c8]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt>
  78:     0x7fd6d8baca2c - <rustc_query_system[41100cafef1fb88d]::dep_graph::graph::DepGraph<rustc_middle[ca61dcd531efc7c8]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt>
  79:     0x7fd6d8baca2c - <rustc_query_system[41100cafef1fb88d]::dep_graph::graph::DepGraph<rustc_middle[ca61dcd531efc7c8]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt>
  80:     0x7fd6d8baca2c - <rustc_query_system[41100cafef1fb88d]::dep_graph::graph::DepGraph<rustc_middle[ca61dcd531efc7c8]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt>
  81:     0x7fd6d8bac2e7 - <rustc_query_system[41100cafef1fb88d]::dep_graph::graph::DepGraph<rustc_middle[ca61dcd531efc7c8]::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt>
  82:     0x7fd6d9640599 - rustc_query_system[41100cafef1fb88d]::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt, rustc_span[c6bedfd0c66fb146]::def_id::LocalDefId, &rustc_middle[ca61dcd531efc7c8]::mir::query::BorrowCheckResult>
  83:     0x7fd6d8af91ae - rustc_query_system[41100cafef1fb88d]::query::plumbing::try_execute_query::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt, rustc_query_system[41100cafef1fb88d]::query::caches::DefaultCache<rustc_span[c6bedfd0c66fb146]::def_id::LocalDefId, &rustc_middle[ca61dcd531efc7c8]::mir::query::BorrowCheckResult>>
  84:     0x7fd6d8c006ea - <rustc_query_impl[46a3cb9608bcfa63]::Queries as rustc_middle[ca61dcd531efc7c8]::ty::query::QueryEngine>::mir_borrowck
  85:     0x7fd6d86ae206 - rustc_typeck[1151d2025d9ba668]::collect::type_of::type_of
  86:     0x7fd6d8bb3937 - <rustc_query_system[41100cafef1fb88d]::dep_graph::graph::DepGraph<rustc_middle[ca61dcd531efc7c8]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[ca61dcd531efc7c8]::ty::context::TyCtxt, rustc_span[c6bedfd0c66fb146]::def_id::DefId, rustc_middle[ca61dcd531efc7c8]::ty::Ty>
  87:     0x7fd6d8b4084a - rustc_query_system[41100cafef1fb88d]::query::plumbing::get_query::<rustc_query_impl[46a3cb9608bcfa63]::queries::type_of, rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt>
  88:     0x7fd6d85b3d84 - rustc_typeck[1151d2025d9ba668]::check::check::check_item_type
  89:     0x7fd6d869f66b - <rustc_middle[ca61dcd531efc7c8]::hir::map::Map>::visit_item_likes_in_module::<rustc_typeck[1151d2025d9ba668]::check::CheckItemTypesVisitor>
  90:     0x7fd6d93b535c - rustc_typeck[1151d2025d9ba668]::check::check::check_mod_item_types
  91:     0x7fd6d96cc06f - <rustc_query_system[41100cafef1fb88d]::dep_graph::graph::DepGraph<rustc_middle[ca61dcd531efc7c8]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[ca61dcd531efc7c8]::ty::context::TyCtxt, rustc_span[c6bedfd0c66fb146]::def_id::LocalDefId, ()>
  92:     0x7fd6d8afb2fe - rustc_query_system[41100cafef1fb88d]::query::plumbing::try_execute_query::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt, rustc_query_system[41100cafef1fb88d]::query::caches::DefaultCache<rustc_span[c6bedfd0c66fb146]::def_id::LocalDefId, ()>>
  93:     0x7fd6d9656a43 - rustc_query_system[41100cafef1fb88d]::query::plumbing::get_query::<rustc_query_impl[46a3cb9608bcfa63]::queries::check_mod_item_types, rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt>
  94:     0x7fd6d943464d - <rustc_middle[ca61dcd531efc7c8]::hir::map::Map>::for_each_module::<rustc_typeck[1151d2025d9ba668]::check_crate::{closure#6}::{closure#0}>
  95:     0x7fd6d93fac48 - <rustc_session[881d207b34e91f9f]::session::Session>::time::<(), rustc_typeck[1151d2025d9ba668]::check_crate::{closure#6}>
  96:     0x7fd6d93cdbc3 - rustc_typeck[1151d2025d9ba668]::check_crate
  97:     0x7fd6d9150667 - rustc_interface[8b8682ff349448b4]::passes::analysis
  98:     0x7fd6d96e32b5 - <rustc_query_system[41100cafef1fb88d]::dep_graph::graph::DepGraph<rustc_middle[ca61dcd531efc7c8]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[ca61dcd531efc7c8]::ty::context::TyCtxt, (), core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>>
  99:     0x7fd6d9624ea1 - rustc_query_system[41100cafef1fb88d]::query::plumbing::try_execute_query::<rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt, rustc_query_system[41100cafef1fb88d]::query::caches::DefaultCache<(), core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>>>
 100:     0x7fd6d9665a9e - rustc_query_system[41100cafef1fb88d]::query::plumbing::get_query::<rustc_query_impl[46a3cb9608bcfa63]::queries::analysis, rustc_query_impl[46a3cb9608bcfa63]::plumbing::QueryCtxt>
 101:     0x7fd6d912bf27 - <rustc_interface[8b8682ff349448b4]::passes::QueryContext>::enter::<rustc_driver[7ec1e2549f75ff84]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>>
 102:     0x7fd6d9116c78 - <rustc_interface[8b8682ff349448b4]::interface::Compiler>::enter::<rustc_driver[7ec1e2549f75ff84]::run_compiler::{closure#1}::{closure#2}, core[649e541f68e0944c]::result::Result<core[649e541f68e0944c]::option::Option<rustc_interface[8b8682ff349448b4]::queries::Linker>, rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>>
 103:     0x7fd6d914051f - rustc_span[c6bedfd0c66fb146]::with_source_map::<core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>, rustc_interface[8b8682ff349448b4]::interface::create_compiler_and_run<core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>, rustc_driver[7ec1e2549f75ff84]::run_compiler::{closure#1}>::{closure#1}>
 104:     0x7fd6d912a5f4 - rustc_interface[8b8682ff349448b4]::interface::create_compiler_and_run::<core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>, rustc_driver[7ec1e2549f75ff84]::run_compiler::{closure#1}>
 105:     0x7fd6d9113fb2 - <scoped_tls[3e040dd67153ed8a]::ScopedKey<rustc_span[c6bedfd0c66fb146]::SessionGlobals>>::set::<rustc_interface[8b8682ff349448b4]::interface::run_compiler<core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>, rustc_driver[7ec1e2549f75ff84]::run_compiler::{closure#1}>::{closure#0}, core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>>
 106:     0x7fd6d913ae8f - std[9bd8fc2679550d2b]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8b8682ff349448b4]::util::run_in_thread_pool_with_globals<rustc_interface[8b8682ff349448b4]::interface::run_compiler<core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>, rustc_driver[7ec1e2549f75ff84]::run_compiler::{closure#1}>::{closure#0}, core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>>::{closure#0}, core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>>
 107:     0x7fd6d912d479 - <<std[9bd8fc2679550d2b]::thread::Builder>::spawn_unchecked_<rustc_interface[8b8682ff349448b4]::util::run_in_thread_pool_with_globals<rustc_interface[8b8682ff349448b4]::interface::run_compiler<core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>, rustc_driver[7ec1e2549f75ff84]::run_compiler::{closure#1}>::{closure#0}, core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>>::{closure#0}, core[649e541f68e0944c]::result::Result<(), rustc_errors[94fb9cd2dcbb52d6]::ErrorGuaranteed>>::{closure#1} as core[649e541f68e0944c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
 108:     0x7fd6d68ab3c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1e4cdc05936d75d5
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/alloc/src/boxed.rs:1866:9
 109:     0x7fd6d68ab3c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h627ceec73be0ad94
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/alloc/src/boxed.rs:1866:9
 110:     0x7fd6d68ab3c3 - std::sys::unix::thread::Thread::new::thread_start::hff6fe6753bb13e69
                               at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/sys/unix/thread.rs:108:17
 111:     0x7fd6d66835c2 - start_thread
 112:     0x7fd6d6708584 - __clone
 113:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: 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: rustc 1.62.0-nightly (e85edd9a8 2022-04-28) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `lobby::<impl at src/lobby.rs:185:1: 374:2>::listen`
#1 [mir_borrowck] borrow-checking `lobby::<impl at src/lobby.rs:185:1: 374:2>::listen`
#2 [type_of] computing type of `lobby::<impl at src/lobby.rs:185:1: 374:2>::listen::{opaque#0}`
#3 [check_mod_item_types] checking item types in module `lobby`
#4 [analysis] running analysis passes on this crate
end of query stack
Backtrace

stack backtrace:
   0: rust_begin_unwind
             at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/core/src/panicking.rs:142:14
   2: core::panicking::panic_bounds_check
             at /rustc/e85edd9a844b523a02dbd89f3c02cd13e4c9fe46/library/core/src/panicking.rs:84:5
   3: <alloc::vec::drain_filter::DrainFilter<rustc_typeck::check::fn_ctxt::arg_matrix::Error, <rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types::{closure#4}> as core::ops::drop::Drop>::drop
   4: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types
   5: <rustc_typeck::check::fn_ctxt::FnCtxt>::confirm_builtin_call
   6: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_call
   7: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
   8: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types
   9: <rustc_typeck::check::fn_ctxt::FnCtxt>::confirm_builtin_call
  10: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_call
  11: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  12: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  13: <rustc_typeck::check::fn_ctxt::FnCtxt>::demand_scrutinee_type
  14: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_match
  15: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  16: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  17: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt
  18: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  19: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  20: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  21: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_match
  22: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  23: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  24: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  25: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  26: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  27: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  28: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  29: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  30: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  31: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  32: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  33: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  34: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  35: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt
  36: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  37: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  38: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  39: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  40: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  41: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  42: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  43: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  44: rustc_typeck::check::check::check_fn
  45: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_closure
  46: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  47: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types
  48: <rustc_typeck::check::fn_ctxt::FnCtxt>::confirm_builtin_call
  49: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_call
  50: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  51: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  52: rustc_typeck::check::check::check_fn
  53: <rustc_infer::infer::InferCtxtBuilder>::enter::<&rustc_middle::ty::context::TypeckResults, <rustc_typeck::check::inherited::InheritedBuilder>::enter<rustc_typeck::check::typeck_with_fallback<rustc_typeck::check::typeck::{closure#0}>::{closure#1}, &rustc_middle::ty::context::TypeckResults>::{closure#0}>
  54: rustc_typeck::check::typeck
  55: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>
  56: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>>
  57: rustc_query_system::query::plumbing::force_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
  58: rustc_query_impl::query_callbacks::typeck::force_from_dep_node
  59: <rustc_middle::ty::context::TyCtxt as rustc_query_system::dep_graph::DepContext>::try_force_from_dep_node
  60: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  61: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  62: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  63: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  64: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  65: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl::plumbing::QueryCtxt>
  66: rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::BorrowCheckResult>
  67: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::BorrowCheckResult>>
  68: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
  69: rustc_typeck::collect::type_of::type_of
  70: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId, rustc_middle::ty::Ty>
  71: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::type_of, rustc_query_impl::plumbing::QueryCtxt>
  72: rustc_typeck::check::check::check_item_type
  73: <rustc_middle::hir::map::Map>::visit_item_likes_in_module::<rustc_typeck::check::CheckItemTypesVisitor>
  74: rustc_typeck::check::check::check_mod_item_types
  75: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, ()>
  76: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, ()>>
  77: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::check_mod_item_types, rustc_query_impl::plumbing::QueryCtxt>
  78: <rustc_middle::hir::map::Map>::for_each_module::<rustc_typeck::check_crate::{closure#6}::{closure#0}>
  79: <rustc_session::session::Session>::time::<(), rustc_typeck::check_crate::{closure#6}>
  80: rustc_typeck::check_crate
  81: rustc_interface::passes::analysis
  82: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  83: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
  84: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  85: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  86: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
  87: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
  88: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
  89: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@brkydnc brkydnc added C-bug Category: This is a bug. 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. labels May 1, 2022
@brkydnc brkydnc closed this as completed May 1, 2022
@brkydnc brkydnc reopened this May 1, 2022
@brkydnc
Copy link
Author

brkydnc commented May 1, 2022

I don't exactly know how much detail I should be giving about the code. If the current snippet is not adequate, I can expose more of it.

@brkydnc
Copy link
Author

brkydnc commented May 1, 2022

I noticed that the handle() function's host parameter's type is wrong. It should have been host: Member<Host>, instead of Member<Self>.

async fn handle(
    guest_client: Client, 
    host_client: &mut Client,
    result: ClientListenResult,
    host: &mut Member<Self>, // This is wrong, Self = Guest
    guest: &mut Member<Guest>
) {}

async fn handle(
    guest_client: Client, 
    host_client: &mut Client,
    result: ClientListenResult,
    host: &mut Member<Host>, // This is the correct type
    guest: &mut Member<Guest>
) {}

I also noticed that I skipped the host_client: &mut Client argument in the Guest::handle() call inside the select!

// `host_client` is missing
Guest::handle(guest_client, result, &mut self.host, &mut self.guest).await;

// Fix
Guest::handle(guest_client, &mut host_client, result, &mut self.host, &mut self.guest).await;

Currently, the code has two errors. When I fix them, the code compiles straightaway. When I fix only one of them, the compiler shows me the other error, without crashing. But interestingly when I don't fix any of the errors, and leave them as they are, the compiler crashes.

@compiler-errors
Copy link
Member

compiler-errors commented May 28, 2022

Hey @brkydnc, is there a way that you could minimize this? The code you provided is missing a ton of types and method signatures. I tried my best to reproduce your issue but I could not because I cannot guess what more than half of these methods should be taking as inputs and outputs.

@brkydnc
Copy link
Author

brkydnc commented May 28, 2022

Hi @compiler-errors, I'm sorry that I hadn't included a minimized version before your comment. Here is a minimized version of the code that triggers the exact same compiler bug.

struct A;
struct B;
struct C;

fn whoops(_: A, _: B, _: A) { }

fn main() {
    whoops(B, C);
}

I realized that this does not crash the compiler on newer versions, should I close this issue?

@compiler-errors
Copy link
Member

I think this was fixed by #97303, thanks for filing the report and thanks for creating a minimization!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. 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.
Projects
None yet
Development

No branches or pull requests

2 participants