Skip to content
New issue

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

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

Already on GitHub? # to your account

rustc crash #106062

Closed
sfilargi opened this issue Dec 22, 2022 · 5 comments · Fixed by #106642
Closed

rustc crash #106062

sfilargi opened this issue Dec 22, 2022 · 5 comments · Fixed by #106642
Assignees
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been 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.

Comments

@sfilargi
Copy link

sfilargi commented Dec 22, 2022

Code

The full repo is here: https://drive.google.com/file/d/1aR7gEIk0S2EeC-Vmd_iAoAKlC_i9ZEOA/view?usp=share_link

Meta

rustc --version --verbose:

rustc 1.63.0 (4b91a6ea7 2022-08-08)
binary: rustc
commit-hash: 4b91a6ea7258a947e59c6522cd5898e7c0a6a88f
commit-date: 2022-08-08
host: x86_64-unknown-linux-gnu
release: 1.63.0
LLVM version: 14.0.5

Error output

error[E0573]: expected type, found variant `Ok`
  --> src/rpc.rs:51:100                                                                                                                                                                                               |                                                                                                                                                                                                               51 |     async fn connection_handler(mut stream: TcpStream, mut handler: impl RequestHandler) -> Result<Ok, std::io::Error> {
   |                                                                                                    ^^ not a type                                                                                                 |                                                                                                                                                                                                               help: try using the variant's enum                                                                                                                                                                                    |
51 |     async fn connection_handler(mut stream: TcpStream, mut handler: impl RequestHandler) -> Result<core::result::Result, std::io::Error> {
   |                                                                                                    ~~~~~~~~~~~~~~~~~~~~
51 |     async fn connection_handler(mut stream: TcpStream, mut handler: impl RequestHandler) -> Result<serde::__private, std::io::Error> {
   |                                                                                                    ~~~~~~~~~~~~~~~~
51 |     async fn connection_handler(mut stream: TcpStream, mut handler: impl RequestHandler) -> Result<std::result::Result, std::io::Error> {
   |                                                                                                    ~~~~~~~~~~~~~~~~~~~

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: PlaceBuilder { base: Upvar { var_hir_id: LocalVarId(HirId { owner: DefId(0:107 ~ raft[7718]::rpc::{impl#2}::spawn), local_id: 8 }), closur
e_def_id: DefId(0:111 ~ raft[7718]::rpc::{impl#2}::spawn::{closure#0}::{closure#0}), closure_kind: FnOnce }, projection: [] }', compiler/rustc_mir_build/src/build/expr/as_place.rs:335:69
stack backtrace:
   0:     0x7fb46c59a18d - std::backtrace_rs::backtrace::libunwind::trace::h8217d0a8f3fd2f41
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fb46c59a18d - std::backtrace_rs::backtrace::trace_unsynchronized::h308103876b3af410
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fb46c59a18d - std::sys_common::backtrace::_print_fmt::hc208018c6153605e
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fb46c59a18d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf89a7ed694dfb585
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fb46c5f5f7c - core::fmt::write::h21038c1382fe4264
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/fmt/mod.rs:1197:17
   5:     0x7fb46c58b8a1 - std::io::Write::write_fmt::h7dbb1c9a3c254aef
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/io/mod.rs:1672:15
   6:     0x7fb46c59ce55 - std::sys_common::backtrace::_print::h4e8889719c9ddeb8
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fb46c59ce55 - std::sys_common::backtrace::print::h1506fe2cb3022667
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fb46c59ce55 - std::panicking::default_hook::{{closure}}::hd9d7ce2a8a782440
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:295:22
   9:     0x7fb46c59cb76 - std::panicking::default_hook::h5b16ec25444b1b5d
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:314:9
  10:     0x7fb46cd77b54 - rustc_driver[e01eec72899701d3]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fb45b3f2c73 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hb3021bfb9a7b232f
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/alloc/src/boxed.rs:1965:9
  12:     0x7fb45b3cab8d - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h6388fa786674c611
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/proc_macro/src/bridge/client.rs:328:21
  13:     0x7fb46c59d52a - std::panicking::rust_panic_with_hook::hb0138cb6e6fea3e4
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:702:17
  14:     0x7fb46c59d367 - std::panicking::begin_panic_handler::{{closure}}::h4cb67095557cd1aa                                                                                                                                                    at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:588:13
  15:     0x7fb46c59a644 - std::sys_common::backtrace::__rust_end_short_backtrace::h2bfcac279dcdc911                                                                                                                                              at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:138:18
  16:     0x7fb46c59d099 - rust_begin_unwind                                                                                                                                                                                                      at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5                                                                                                 17:     0x7fb46c562253 - core::panicking::panic_fmt::h1de71520faaa17d3
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14                                                                                               18:     0x7fb46c562343 - core::result::unwrap_failed::hc0baa33ef8bc7db8                                                                                                                                                                         at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/result.rs:1805:5
  19:     0x7fb46e5f7cf5 - <rustc_mir_build[af6ff6e89519884]::build::expr::as_place::PlaceBuilder>::into_place                                                                                                       20:     0x7fb46e5930f8 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest                                                                                                                        21:     0x7fb46e5914ef - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_temp_inner                                                                                                                         22:     0x7fb46e5af5b0 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_operand
  23:     0x7fb46e58b473 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_call_operand
  24:     0x7fb46e58b658 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_call_operand
  25:     0x7fb46e59341b - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest
  26:     0x7fb46e5914ef - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_temp_inner
  27:     0x7fb46e5af5b0 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_operand
  28:     0x7fb46e58b473 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_call_operand
  29:     0x7fb46e58b658 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_call_operand
  30:     0x7fb46e59341b - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest
  31:     0x7fb46e5914ef - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_temp_inner
  32:     0x7fb46e5af5b0 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_operand
  33:     0x7fb46e58b473 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_call_operand
  34:     0x7fb46e58b658 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_call_operand
  35:     0x7fb46e59341b - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest
  36:     0x7fb46e5914ef - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_temp_inner
  37:     0x7fb46e599aae - <rustc_mir_build[af6ff6e89519884]::build::Builder>::stmt_expr
  38:     0x7fb46e59948a - <rustc_mir_build[af6ff6e89519884]::build::Builder>::stmt_expr
  39:     0x7fb46e587c77 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::ast_block_stmts
  40:     0x7fb46e5a9e65 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::in_scope::<<rustc_mir_build[af6ff6e89519884]::build::Builder>::ast_block::{closure#2}::{closure#0}, ()>
  41:     0x7fb46e593c14 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest
  42:     0x7fb46e595e5d - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest
  43:     0x7fb46e5914ef - <rustc_mir_build[af6ff6e89519884]::build::Builder>::as_temp_inner
  44:     0x7fb46e594c4f - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest
  45:     0x7fb46e592815 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest
  46:     0x7fb46e58920b - <rustc_mir_build[af6ff6e89519884]::build::Builder>::ast_block_stmts
  47:     0x7fb46e5a9e65 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::in_scope::<<rustc_mir_build[af6ff6e89519884]::build::Builder>::ast_block::{closure#2}::{closure#0}, ()>
  48:     0x7fb46e593c14 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest
  49:     0x7fb46e592815 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest
  50:     0x7fb46e592815 - <rustc_mir_build[af6ff6e89519884]::build::Builder>::expr_into_dest
  51:     0x7fb46e583ed6 - rustc_mir_build[af6ff6e89519884]::build::construct_fn::<core[3edb0f9afb6adb32]::iter::adapters::chain::Chain<alloc[59e4fb8ddcfb913c]::vec::into_iter::IntoIter<rustc_mir_build[af6ff6e89
519884]::build::ArgInfo>, core[3edb0f9afb6adb32]::iter::adapters::map::Map<core[3edb0f9afb6adb32]::iter::adapters::enumerate::Enumerate<core[3edb0f9afb6adb32]::slice::iter::Iter<rustc_hir[2a1474d182a5b4d0]::hir:
:Param>>, rustc_mir_build[af6ff6e89519884]::build::mir_build::{closure#1}::{closure#1}>>>
  52:     0x7fb46e5e5796 - <rustc_infer[dac8c065ff7906eb]::infer::InferCtxtBuilder>::enter::<rustc_middle[6ba33e07887d312d]::mir::Body, rustc_mir_build[af6ff6e89519884]::build::mir_build::{closure#1}>
  53:     0x7fb46e5819bb - rustc_mir_build[af6ff6e89519884]::build::mir_built
  54:     0x7fb46f3e3e7c - <rustc_query_system[141d649b4129d34f]::dep_graph::graph::DepGraph<rustc_middle[6ba33e07887d312d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6ba33e07887d312d]::ty::contex
t::TyCtxt, rustc_middle[6ba33e07887d312d]::ty::WithOptConstParam<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId>, &rustc_data_structures[a72e3ab837655e00]::steal::Steal<rustc_middle[6ba33e07887d312d]::mir::Bod
y>>
  55:     0x7fb46e922159 - rustc_query_system[141d649b4129d34f]::query::plumbing::try_execute_query::<rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt, rustc_query_system[141d649b4129d34f]::query::caches
:DefaultCache<rustc_middle[6ba33e07887d312d]::ty::WithOptConstParam<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId>, &rustc_data_structures[a72e3ab837655e00]::steal::Steal<rustc_middle[6ba33e07887d312d]::mir::Body>>>
  56:     0x7fb46e908b45 - <rustc_query_impl[f9d56364e2ba3b26]::Queries as rustc_middle[6ba33e07887d312d]::ty::query::QueryEngine>::mir_built                                                                        57:     0x7fb46e22706f - rustc_mir_transform[93126a898a3686a2]::check_unsafety::unsafety_check_result
  58:     0x7fb46e222ce0 - <rustc_mir_transform[93126a898a3686a2]::check_unsafety::provide::{closure#0} as core[3edb0f9afb6adb32]::ops::function::FnOnce<(rustc_middle[6ba33e07887d312d]::ty::context::TyCtxt, rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId)>>::call_once                                                                                                                                                           59:     0x7fb46f3eeff1 - <rustc_query_system[141d649b4129d34f]::dep_graph::graph::DepGraph<rustc_middle[6ba33e07887d312d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6ba33e07887d312d]::ty::contex
t::TyCtxt, rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId, &rustc_middle[6ba33e07887d312d]::mir::query::UnsafetyCheckResult>                                                                                       60:     0x7fb46e936276 - rustc_query_system[141d649b4129d34f]::query::plumbing::try_execute_query::<rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt, rustc_query_system[141d649b4129d34f]::query::caches::DefaultCache<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId, &rustc_middle[6ba33e07887d312d]::mir::query::UnsafetyCheckResult>>
  61:     0x7fb46e90a04e - <rustc_query_impl[f9d56364e2ba3b26]::Queries as rustc_middle[6ba33e07887d312d]::ty::query::QueryEngine>::unsafety_check_result                                                            62:     0x7fb46e22a53b - rustc_mir_transform[93126a898a3686a2]::check_unsafety::unsafety_check_result                                                                                                              63:     0x7fb46e222ce0 - <rustc_mir_transform[93126a898a3686a2]::check_unsafety::provide::{closure#0} as core[3edb0f9afb6adb32]::ops::function::FnOnce<(rustc_middle[6ba33e07887d312d]::ty::context::TyCtxt, rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId)>>::call_once
  64:     0x7fb46f3eeff1 - <rustc_query_system[141d649b4129d34f]::dep_graph::graph::DepGraph<rustc_middle[6ba33e07887d312d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6ba33e07887d312d]::ty::contex
t::TyCtxt, rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId, &rustc_middle[6ba33e07887d312d]::mir::query::UnsafetyCheckResult>
  65:     0x7fb46e936276 - rustc_query_system[141d649b4129d34f]::query::plumbing::try_execute_query::<rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt, rustc_query_system[141d649b4129d34f]::query::caches:
:DefaultCache<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId, &rustc_middle[6ba33e07887d312d]::mir::query::UnsafetyCheckResult>>
  66:     0x7fb46e90a04e - <rustc_query_impl[f9d56364e2ba3b26]::Queries as rustc_middle[6ba33e07887d312d]::ty::query::QueryEngine>::unsafety_check_result
  67:     0x7fb46e22a53b - rustc_mir_transform[93126a898a3686a2]::check_unsafety::unsafety_check_result
  68:     0x7fb46e222ce0 - <rustc_mir_transform[93126a898a3686a2]::check_unsafety::provide::{closure#0} as core[3edb0f9afb6adb32]::ops::function::FnOnce<(rustc_middle[6ba33e07887d312d]::ty::context::TyCtxt, rust
c_span[fb9cf5df1e5e5539]::def_id::LocalDefId)>>::call_once
  69:     0x7fb46f3eeff1 - <rustc_query_system[141d649b4129d34f]::dep_graph::graph::DepGraph<rustc_middle[6ba33e07887d312d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6ba33e07887d312d]::ty::contex
t::TyCtxt, rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId, &rustc_middle[6ba33e07887d312d]::mir::query::UnsafetyCheckResult>
  70:     0x7fb46e936276 - rustc_query_system[141d649b4129d34f]::query::plumbing::try_execute_query::<rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt, rustc_query_system[141d649b4129d34f]::query::caches:
:DefaultCache<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId, &rustc_middle[6ba33e07887d312d]::mir::query::UnsafetyCheckResult>>
  71:     0x7fb46e90a04e - <rustc_query_impl[f9d56364e2ba3b26]::Queries as rustc_middle[6ba33e07887d312d]::ty::query::QueryEngine>::unsafety_check_result
  72:     0x7fb46e1b83e9 - rustc_mir_transform[93126a898a3686a2]::mir_const
  73:     0x7fb46f3e3e7c - <rustc_query_system[141d649b4129d34f]::dep_graph::graph::DepGraph<rustc_middle[6ba33e07887d312d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6ba33e07887d312d]::ty::contex
t::TyCtxt, rustc_middle[6ba33e07887d312d]::ty::WithOptConstParam<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId>, &rustc_data_structures[a72e3ab837655e00]::steal::Steal<rustc_middle[6ba33e07887d312d]::mir::Bod
y>>
  74:     0x7fb46e922159 - rustc_query_system[141d649b4129d34f]::query::plumbing::try_execute_query::<rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt, rustc_query_system[141d649b4129d34f]::query::caches:
:DefaultCache<rustc_middle[6ba33e07887d312d]::ty::WithOptConstParam<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId>, &rustc_data_structures[a72e3ab837655e00]::steal::Steal<rustc_middle[6ba33e07887d312d]::mir::
Body>>>
  75:     0x7fb46e908c7c - <rustc_query_impl[f9d56364e2ba3b26]::Queries as rustc_middle[6ba33e07887d312d]::ty::query::QueryEngine>::mir_const
  76:     0x7fb46e1ba74c - rustc_mir_transform[93126a898a3686a2]::mir_promoted
  77:     0x7fb46f3e43ab - <rustc_query_system[141d649b4129d34f]::dep_graph::graph::DepGraph<rustc_middle[6ba33e07887d312d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6ba33e07887d312d]::ty::contex
t::TyCtxt, rustc_middle[6ba33e07887d312d]::ty::WithOptConstParam<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId>, (&rustc_data_structures[a72e3ab837655e00]::steal::Steal<rustc_middle[6ba33e07887d312d]::mir::Bo
dy>, &rustc_data_structures[a72e3ab837655e00]::steal::Steal<rustc_index[421bc508459c2c3a]::vec::IndexVec<rustc_middle[6ba33e07887d312d]::mir::Promoted, rustc_middle[6ba33e07887d312d]::mir::Body>>)>
  78:     0x7fb46e9236a2 - rustc_query_system[141d649b4129d34f]::query::plumbing::try_execute_query::<rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt, rustc_query_system[141d649b4129d34f]::query::caches:
:DefaultCache<rustc_middle[6ba33e07887d312d]::ty::WithOptConstParam<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId>, (&rustc_data_structures[a72e3ab837655e00]::steal::Steal<rustc_middle[6ba33e07887d312d]::mir:
:Body>, &rustc_data_structures[a72e3ab837655e00]::steal::Steal<rustc_index[421bc508459c2c3a]::vec::IndexVec<rustc_middle[6ba33e07887d312d]::mir::Promoted, rustc_middle[6ba33e07887d312d]::mir::Body>>)>>
  79:     0x7fb46e909204 - <rustc_query_impl[f9d56364e2ba3b26]::Queries as rustc_middle[6ba33e07887d312d]::ty::query::QueryEngine>::mir_promoted
  80:     0x7fb46e6d9359 - rustc_borrowck[490eaa621389bc7b]::mir_borrowck
  81:     0x7fb46e6d6430 - <rustc_borrowck[490eaa621389bc7b]::provide::{closure#0} as core[3edb0f9afb6adb32]::ops::function::FnOnce<(rustc_middle[6ba33e07887d312d]::ty::context::TyCtxt, rustc_span[fb9cf5df1e5e55
39]::def_id::LocalDefId)>>::call_once
  82:     0x7fb46f3eeae1 - <rustc_query_system[141d649b4129d34f]::dep_graph::graph::DepGraph<rustc_middle[6ba33e07887d312d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6ba33e07887d312d]::ty::contex
t::TyCtxt, rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId, &rustc_middle[6ba33e07887d312d]::mir::query::BorrowCheckResult>
  83:     0x7fb46e935266 - rustc_query_system[141d649b4129d34f]::query::plumbing::try_execute_query::<rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt, rustc_query_system[141d649b4129d34f]::query::caches:
:DefaultCache<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId, &rustc_middle[6ba33e07887d312d]::mir::query::BorrowCheckResult>>
  84:     0x7fb46e90a6aa - <rustc_query_impl[f9d56364e2ba3b26]::Queries as rustc_middle[6ba33e07887d312d]::ty::query::QueryEngine>::mir_borrowck
  85:     0x7fb46e36ab35 - rustc_typeck[4304dccefed204b7]::collect::type_of::type_of                                                                                                                                 86:     0x7fb46e8aa20c - <rustc_query_system[141d649b4129d34f]::dep_graph::graph::DepGraph<rustc_middle[6ba33e07887d312d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6ba33e07887d312d]::ty::contex
t::TyCtxt, rustc_span[fb9cf5df1e5e5539]::def_id::DefId, rustc_middle[6ba33e07887d312d]::ty::Ty>                                                                                                                      87:     0x7fb46e987df3 - rustc_query_system[141d649b4129d34f]::query::plumbing::get_query::<rustc_query_impl[f9d56364e2ba3b26]::queries::type_of, rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt>
  88:     0x7fb46ee8407c - <rustc_middle[6ba33e07887d312d]::ty::context::TyCtxt>::bound_type_of                                                                                                                      89:     0x7fb46f74c45b - <rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>::expand_opaque_ty                                                                                                          90:     0x7fb46de5b9d1 - <rustc_middle[6ba33e07887d312d]::ty::Ty as rustc_middle[6ba33e07887d312d]::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>
  91:     0x7fb46dd807d4 - <&rustc_middle[6ba33e07887d312d]::ty::list::List<rustc_middle[6ba33e07887d312d]::ty::Ty> as rustc_middle[6ba33e07887d312d]::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>                                                                                                                                                                           92:     0x7fb46dd7e832 - <rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander as rustc_middle[6ba33e07887d312d]::ty::fold::FallibleTypeFolder>::try_fold_binder::<&rustc_middle[6ba33e07887d312d]::ty::l
ist::List<rustc_middle[6ba33e07887d312d]::ty::Ty>>                                                                                                                                                                   93:     0x7fb46f78b5a9 - <rustc_middle[6ba33e07887d312d]::ty::Ty as rustc_middle[6ba33e07887d312d]::ty::fold::TypeSuperFoldable>::super_fold_with::<rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>  94:     0x7fb46ed8e667 - <&rustc_middle[6ba33e07887d312d]::ty::list::List<rustc_middle[6ba33e07887d312d]::ty::subst::GenericArg> as rustc_middle[6ba33e07887d312d]::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>
  95:     0x7fb46f78b580 - <rustc_middle[6ba33e07887d312d]::ty::Ty as rustc_middle[6ba33e07887d312d]::ty::fold::TypeSuperFoldable>::super_fold_with::<rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>
  96:     0x7fb46ed8e468 - <&rustc_middle[6ba33e07887d312d]::ty::list::List<rustc_middle[6ba33e07887d312d]::ty::subst::GenericArg> as rustc_middle[6ba33e07887d312d]::ty::fold::TypeFoldable>::try_fold_with::<rust
c_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>
  97:     0x7fb46f74c414 - <rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>::expand_opaque_ty
  98:     0x7fb46f74c62d - <rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>::expand_opaque_ty
  99:     0x7fb46de5b9d1 - <rustc_middle[6ba33e07887d312d]::ty::Ty as rustc_middle[6ba33e07887d312d]::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>
 100:     0x7fb46dd807d4 - <&rustc_middle[6ba33e07887d312d]::ty::list::List<rustc_middle[6ba33e07887d312d]::ty::Ty> as rustc_middle[6ba33e07887d312d]::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle[6ba33e
07887d312d]::ty::util::OpaqueTypeExpander>
 101:     0x7fb46dd7e832 - <rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander as rustc_middle[6ba33e07887d312d]::ty::fold::FallibleTypeFolder>::try_fold_binder::<&rustc_middle[6ba33e07887d312d]::ty::l
ist::List<rustc_middle[6ba33e07887d312d]::ty::Ty>>
 102:     0x7fb46f78b5a9 - <rustc_middle[6ba33e07887d312d]::ty::Ty as rustc_middle[6ba33e07887d312d]::ty::fold::TypeSuperFoldable>::super_fold_with::<rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>
 103:     0x7fb46ed8e667 - <&rustc_middle[6ba33e07887d312d]::ty::list::List<rustc_middle[6ba33e07887d312d]::ty::subst::GenericArg> as rustc_middle[6ba33e07887d312d]::ty::fold::TypeFoldable>::try_fold_with::<rust
c_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>
 104:     0x7fb46f78b580 - <rustc_middle[6ba33e07887d312d]::ty::Ty as rustc_middle[6ba33e07887d312d]::ty::fold::TypeSuperFoldable>::super_fold_with::<rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>
 105:     0x7fb46ed8e468 - <&rustc_middle[6ba33e07887d312d]::ty::list::List<rustc_middle[6ba33e07887d312d]::ty::subst::GenericArg> as rustc_middle[6ba33e07887d312d]::ty::fold::TypeFoldable>::try_fold_with::<rust
c_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>
 106:     0x7fb46f74c414 - <rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>::expand_opaque_ty
 107:     0x7fb46f74c62d - <rustc_middle[6ba33e07887d312d]::ty::util::OpaqueTypeExpander>::expand_opaque_ty
 108:     0x7fb46f79c91a - <rustc_middle[6ba33e07887d312d]::ty::context::TyCtxt>::try_expand_impl_trait_type
 109:     0x7fb46e35bec8 - rustc_typeck[4304dccefed204b7]::check::check::check_item_type
 110:     0x7fb46e361cbb - rustc_typeck[4304dccefed204b7]::check::check::check_mod_item_types
 111:     0x7fb46f3efa0f - <rustc_query_system[141d649b4129d34f]::dep_graph::graph::DepGraph<rustc_middle[6ba33e07887d312d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6ba33e07887d312d]::ty::contex
t::TyCtxt, rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId, ()>
 112:     0x7fb46e9372ac - rustc_query_system[141d649b4129d34f]::query::plumbing::try_execute_query::<rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt, rustc_query_system[141d649b4129d34f]::query::caches:
:DefaultCache<rustc_span[fb9cf5df1e5e5539]::def_id::LocalDefId, ()>>
 113:     0x7fb46f4f4583 - rustc_query_system[141d649b4129d34f]::query::plumbing::get_query::<rustc_query_impl[f9d56364e2ba3b26]::queries::check_mod_item_types, rustc_query_impl[f9d56364e2ba3b26]::plumbing::Quer
yCtxt>
 114:     0x7fb46f20b8ea - <rustc_session[72c90254a58d88d1]::session::Session>::time::<(), rustc_typeck[4304dccefed204b7]::check_crate::{closure#6}>
 115:     0x7fb46f1e9083 - rustc_typeck[4304dccefed204b7]::check_crate
 116:     0x7fb46ef5a6b7 - rustc_interface[be6c6c80f2cd8cf2]::passes::analysis
 117:     0x7fb46f408ea5 - <rustc_query_system[141d649b4129d34f]::dep_graph::graph::DepGraph<rustc_middle[6ba33e07887d312d]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6ba33e07887d312d]::ty::contex
t::TyCtxt, (), core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>>
 118:     0x7fb46f4baa3d - rustc_query_system[141d649b4129d34f]::query::plumbing::try_execute_query::<rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt, rustc_query_system[141d649b4129d34f]::query::caches:
:DefaultCache<(), core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>>>
 119:     0x7fb46f5049fe - rustc_query_system[141d649b4129d34f]::query::plumbing::get_query::<rustc_query_impl[f9d56364e2ba3b26]::queries::analysis, rustc_query_impl[f9d56364e2ba3b26]::plumbing::QueryCtxt>
 120:     0x7fb46ef3df87 - <rustc_interface[be6c6c80f2cd8cf2]::passes::QueryContext>::enter::<rustc_driver[e01eec72899701d3]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[3edb0f9afb6adb32]::result::
Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>>
 121:     0x7fb46ef2846f - <rustc_interface[be6c6c80f2cd8cf2]::interface::Compiler>::enter::<rustc_driver[e01eec72899701d3]::run_compiler::{closure#1}::{closure#2}, core[3edb0f9afb6adb32]::result::Result<core[3edb0f9afb6adb32]::option::Option<rustc_interface[be6c6c80f2cd8cf2]::queries::Linker>, rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>>
 122:     0x7fb46ef21a7f - rustc_span[fb9cf5df1e5e5539]::with_source_map::<core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>, rustc_interface[be6c6c80f2cd8cf2]::interface::create_compiler_and_run<core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>, rustc_driver[e01eec72899701d3]::run_compiler::{closure#1}>::{closure#1}>
 123:     0x7fb46ef29302 - <scoped_tls[134a193f706323ee]::ScopedKey<rustc_span[fb9cf5df1e5e5539]::SessionGlobals>>::set::<rustc_interface[be6c6c80f2cd8cf2]::interface::run_compiler<core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>, rustc_driver[e01eec72899701d3]::run_compiler::{closure#1}>::{closure#0}, core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>>
 124:     0x7fb46ef4c99f - std[f9ee9c7d4fd68eda]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[be6c6c80f2cd8cf2]::util::run_in_thread_pool_with_globals<rustc_interface[be6c6c80f2cd8cf2]::interface::run_compiler<core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>, rustc_driver[e01eec72899701d3]::run_compiler::{closure#1}>::{closure#0}, core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>>::{closure#0}, core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>>
 125:     0x7fb46ef3e529 - <<std[f9ee9c7d4fd68eda]::thread::Builder>::spawn_unchecked_<rustc_interface[be6c6c80f2cd8cf2]::util::run_in_thread_pool_with_globals<rustc_interface[be6c6c80f2cd8cf2]::interface::run_compiler<core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>, rustc_driver[e01eec72899701d3]::run_compiler::{closure#1}>::{closure#0}, core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>>::{closure#0}, core[3edb0f9afb6adb32]::result::Result<(), rustc_errors[b2e8492a1747ee42]::ErrorGuaranteed>>::{closure#1} as core[3edb0f9afb6adb32]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
 126:     0x7fb46c5a7463 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1680342795a2dc08
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/alloc/src/boxed.rs:1951:9
 127:     0x7fb46c5a7463 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h45204a69827b0e83
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/alloc/src/boxed.rs:1951:9
 128:     0x7fb46c5a7463 - std::sys::unix::thread::Thread::new::thread_start::h5d4e11bbda4161c8
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys/unix/thread.rs:108:17
 129:     0x7fb46c4cbea7 - start_thread
 130:     0x7fb46c3f9def - clone
 131:                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.63.0 (4b91a6ea7 2022-08-08) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -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 [mir_built] building MIR for `rpc::<impl at src/rpc.rs:44:1: 78:2>::spawn::{closure#0}::{closure#0}`
#1 [unsafety_check_result] unsafety-checking `rpc::<impl at src/rpc.rs:44:1: 78:2>::spawn::{closure#0}::{closure#0}`
#2 [unsafety_check_result] unsafety-checking `rpc::<impl at src/rpc.rs:44:1: 78:2>::spawn::{closure#0}`
#3 [unsafety_check_result] unsafety-checking `rpc::<impl at src/rpc.rs:44:1: 78:2>::spawn`
#4 [mir_const] processing MIR for `rpc::<impl at src/rpc.rs:44:1: 78:2>::spawn`
#5 [mir_promoted] processing `rpc::<impl at src/rpc.rs:44:1: 78:2>::spawn`
#6 [mir_borrowck] borrow-checking `rpc::<impl at src/rpc.rs:44:1: 78:2>::spawn`
#7 [type_of] computing type of `rpc::<impl at src/rpc.rs:44:1: 78:2>::spawn::{opaque#0}`
#8 [check_mod_item_types] checking item types in top-level module
#9 [analysis] running analysis passes on this crate
end of query stack
For more information about this error, try `rustc --explain E0573`.

@sfilargi sfilargi 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 Dec 22, 2022
@ahovgaard
Copy link

For what it's worth, I can reproduce this issue with rustc version 1.63.0, but it doesn't happen with 1.64.0 nor with the latest stable version 1.66.0.

@albertlarsan68
Copy link
Member

Here is it minified, and standalone-ed:

use std::{future::Future, marker::PhantomData};

fn spawn<T>(future: T) -> PhantomData<T::Output>
where
    T: Future,
{
    loop {}
}

#[derive(Debug)]
struct IncomingServer {}
impl IncomingServer {
    async fn connection_handler(handler: impl Sized) -> Result<Ok, std::io::Error> {
        loop {}
    }
    async fn spawn(&self, request_handler: impl Sized) {
        async move {
            spawn(Self::connection_handler(&request_handler));
        };
    }
}

@JohnTitor JohnTitor added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jan 8, 2023
@JohnTitor
Copy link
Member

Triage: This has been fixed on the latest nightly, as reported, and needs a test to close.

@albertlarsan68
Copy link
Member

@rustbot claim

bors added a commit to rust-lang-ci/rust that referenced this issue Jan 11, 2023
Rollup of 14 pull requests

Successful merges:

 - rust-lang#105194 (Add comment to cleanup_kinds)
 - rust-lang#106521 (remove E0280)
 - rust-lang#106628 (Remove unneeded ItemId::Primitive variant)
 - rust-lang#106635 (std sync tests: better type name, clarifying comment)
 - rust-lang#106642 (Add test for rust-lang#106062)
 - rust-lang#106645 ([RFC 2397] Initial implementation)
 - rust-lang#106653 (Fix help docs for -Zallow-features)
 - rust-lang#106657 (Remove myself from rust-lang/rust reviewers)
 - rust-lang#106662 (specialize impl of `ToString` on `bool`)
 - rust-lang#106669 (create helper function for `rustc_lint_defs::Level` and remove it's duplicated code)
 - rust-lang#106671 (Change flags with a fixed default value from Option<bool> to bool)
 - rust-lang#106689 (Fix invalid files array re-creation in rustdoc-gui tester)
 - rust-lang#106690 (Fix scrolling for item declaration block)
 - rust-lang#106698 (Add compiler-errors to some trait system notification groups)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors closed this as completed in f547c4b Jan 11, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants