Repository: rust
Issue: Compiler unexpectedly panicked
Labels: I-ICE,T-compiler,C-bug

I switched branches (to a branch that ordinarily compiles fine), ran `cargo run`, and saw the error below.  It looks like the issue happened while trying to compile Diesel.  Rerunning `cargo run` reproduced the error, but `cargo clean` fixed it.  Sorry I don't have a small sample program to share that would reproduce the issue.

```
$ cargo run
   Compiling api v0.1.0 (/home/jeff/git/vesta/api)
thread 'rustc' panicked at 'Failed to extract DefId: local_def_id_to_hir_id a87141d975409e8c-9a44ec8cde3aa19a', compiler/rustc_middle/src/dep_graph/dep_node.rs:267:17
stack backtrace:
   0:     0x7f3d0bb17d40 - std::backtrace_rs::backtrace::libunwind::trace::h32eb3e08e874dd27
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f3d0bb17d40 - std::backtrace_rs::backtrace::trace_unsynchronized::haa3f451d27bc11a5
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3d0bb17d40 - std::sys_common::backtrace::_print_fmt::h5b94a01bb4289bb5
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f3d0bb17d40 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb070b7fa7e3175df
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f3d0bb72bfe - core::fmt::write::hd5207aebbb9a86e9
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/fmt/mod.rs:1202:17
   5:     0x7f3d0bb08935 - std::io::Write::write_fmt::h3bd699bbd129ab8a
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/io/mod.rs:1679:15
   6:     0x7f3d0bb1a9f3 - std::sys_common::backtrace::_print::h7a21be552fdf58da
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f3d0bb1a9f3 - std::sys_common::backtrace::print::ha85c41fe4dd80b13
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f3d0bb1a9f3 - std::panicking::default_hook::{{closure}}::h04cca40023d0eeca
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:295:22
   9:     0x7f3d0bb1a6df - std::panicking::default_hook::haa3ca8c310ed5402
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:314:9
  10:     0x7f3d0e3482e1 - rustc_driver[cfb34b1539811fe8]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f3d0bb1b22d - std::panicking::rust_panic_with_hook::h7b190ce1a948faac
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:702:17
  12:     0x7f3d0bb1b087 - std::panicking::begin_panic_handler::{{closure}}::hbafbfdc3e1b97f68
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:588:13
  13:     0x7f3d0bb181ec - std::sys_common::backtrace::__rust_end_short_backtrace::hda93e5fef243b4c0
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f3d0bb1ada2 - rust_begin_unwind
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
  15:     0x7f3d0bb6f7d3 - core::panicking::panic_fmt::h8d17ca1073d9a733
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
  16:     0x7f3d0f365f61 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::dep_node::DepNode<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind> as rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepNodeExt>::extract_def_id::{closure#0}
  17:     0x7f3d0cc7ce3b - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::dep_node::DepNode<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind> as rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepNodeExt>::extract_def_id
  18:     0x7f3d0dc646bc - rustc_query_impl[d6191eea714bd250]::plumbing::force_from_dep_node::<rustc_query_impl[d6191eea714bd250]::queries::local_def_id_to_hir_id>
  19:     0x7f3d0cdce291 - <rustc_middle[a9ca1c3f9fd197cd]::ty::context::TyCtxt as rustc_query_system[860ed7b39cdfb46b]::dep_graph::DepContext>::try_force_from_dep_node
  20:     0x7f3d0cdcd022 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  21:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  22:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  23:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  24:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  25:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  26:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  27:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  28:     0x7f3d0d8220ca - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::get_query::<rustc_query_impl[d6191eea714bd250]::queries::evaluate_obligation, rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  29:     0x7f3d0d821235 - <rustc_query_impl[d6191eea714bd250]::Queries as rustc_middle[a9ca1c3f9fd197cd]::ty::query::QueryEngine>::evaluate_obligation
  30:     0x7f3d0cfe0937 - <rustc_trait_selection[f6cb7b5468c1337d]::traits::fulfill::FulfillProcessor as rustc_data_structures[62ce3989ce8140ee]::obligation_forest::ObligationProcessor>::process_obligation
  31:     0x7f3d0cfddd0f - <rustc_data_structures[62ce3989ce8140ee]::obligation_forest::ObligationForest<rustc_trait_selection[f6cb7b5468c1337d]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[f6cb7b5468c1337d]::traits::fulfill::FulfillProcessor, rustc_data_structures[62ce3989ce8140ee]::obligation_forest::Outcome<rustc_trait_selection[f6cb7b5468c1337d]::traits::fulfill::PendingPredicateObligation, rustc_infer[ed26b14e1208c12f]::traits::FulfillmentErrorCode>>
  32:     0x7f3d0cfdd816 - <rustc_trait_selection[f6cb7b5468c1337d]::traits::fulfill::FulfillmentContext as rustc_infer[ed26b14e1208c12f]::traits::engine::TraitEngine>::select_where_possible
  33:     0x7f3d0cf8a4b6 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  34:     0x7f3d0cf880a6 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  35:     0x7f3d0cf880a6 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  36:     0x7f3d0d02067f - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_argument_types
  37:     0x7f3d0cfd4f98 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_call
  38:     0x7f3d0cf87f27 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  39:     0x7f3d0d008d3b - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_match::{closure#0}
  40:     0x7f3d0cf89443 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  41:     0x7f3d0d02067f - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_argument_types
  42:     0x7f3d0cfd4f98 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_call
  43:     0x7f3d0cf87f27 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  44:     0x7f3d0cfcf97f - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  45:     0x7f3d0cf88050 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  46:     0x7f3d0d9824d6 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_return_expr
  47:     0x7f3d0d97a86a - rustc_typeck[4a3b2f91c49b3c3e]::check::check::check_fn
  48:     0x7f3d0d96da75 - <rustc_infer[ed26b14e1208c12f]::infer::InferCtxtBuilder>::enter::<&rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults, <rustc_typeck[4a3b2f91c49b3c3e]::check::inherited::InheritedBuilder>::enter<rustc_typeck[4a3b2f91c49b3c3e]::check::typeck_with_fallback<rustc_typeck[4a3b2f91c49b3c3e]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults>::{closure#0}>
  49:     0x7f3d0d96bc29 - rustc_typeck[4a3b2f91c49b3c3e]::check::typeck
  50:     0x7f3d0dc178ad - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[a9ca1c3f9fd197cd]::ty::context::TyCtxt, rustc_span[8f00505efff112e2]::def_id::LocalDefId, &rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults>
  51:     0x7f3d0dc0a664 - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::try_execute_query::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt, rustc_query_system[860ed7b39cdfb46b]::query::caches::DefaultCache<rustc_span[8f00505efff112e2]::def_id::LocalDefId, &rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults>>
  52:     0x7f3d0e284cae - <rustc_query_impl[d6191eea714bd250]::Queries as rustc_middle[a9ca1c3f9fd197cd]::ty::query::QueryEngine>::typeck
  53:     0x7f3d0e0c5057 - rustc_data_structures[62ce3989ce8140ee]::sync::par_for_each_in::<&[rustc_span[8f00505efff112e2]::def_id::LocalDefId], <rustc_middle[a9ca1c3f9fd197cd]::hir::map::Map>::par_body_owners<rustc_typeck[4a3b2f91c49b3c3e]::check::typeck_item_bodies::{closure#0}>::{closure#0}>
  54:     0x7f3d0e0c4e13 - rustc_typeck[4a3b2f91c49b3c3e]::check::typeck_item_bodies
  55:     0x7f3d0dfcf2e5 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[a9ca1c3f9fd197cd]::ty::context::TyCtxt, (), ()>
  56:     0x7f3d0dfce2be - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::try_execute_query::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt, rustc_query_system[860ed7b39cdfb46b]::query::caches::DefaultCache<(), ()>>
  57:     0x7f3d0dfcdcc7 - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::get_query::<rustc_query_impl[d6191eea714bd250]::queries::typeck_item_bodies, rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  58:     0x7f3d0d6bba9f - <rustc_session[c5946fac61f8bc34]::session::Session>::time::<(), rustc_typeck[4a3b2f91c49b3c3e]::check_crate::{closure#7}>
  59:     0x7f3d0d6bb65f - rustc_typeck[4a3b2f91c49b3c3e]::check_crate
  60:     0x7f3d0d6bac27 - rustc_interface[3182dd864eff9d7d]::passes::analysis
  61:     0x7f3d0e119382 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[a9ca1c3f9fd197cd]::ty::context::TyCtxt, (), core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  62:     0x7f3d0e118a4a - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::try_execute_query::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt, rustc_query_system[860ed7b39cdfb46b]::query::caches::DefaultCache<(), core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>>
  63:     0x7f3d0e118517 - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::get_query::<rustc_query_impl[d6191eea714bd250]::queries::analysis, rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  64:     0x7f3d0d204897 - <rustc_interface[3182dd864eff9d7d]::passes::QueryContext>::enter::<rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  65:     0x7f3d0d1f828c - rustc_interface[3182dd864eff9d7d]::interface::create_compiler_and_run::<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>
  66:     0x7f3d0d1f6ac1 - <scoped_tls[e395fa6e23b19669]::ScopedKey<rustc_span[8f00505efff112e2]::SessionGlobals>>::set::<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  67:     0x7f3d0d1f67af - std[71cb4861428b0c25]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3182dd864eff9d7d]::util::run_in_thread_pool_with_globals<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  68:     0x7f3d0e1abd70 - <<std[71cb4861428b0c25]::thread::Builder>::spawn_unchecked_<rustc_interface[3182dd864eff9d7d]::util::run_in_thread_pool_with_globals<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#1} as core[8c92e53db3fc2eaa]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:     0x7f3d0bb25003 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h49f797984e2121bf
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/boxed.rs:1940:9
  70:     0x7f3d0bb25003 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hfa4f3d0ee6440e0b
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/boxed.rs:1940:9
  71:     0x7f3d0bb25003 - std::sys::unix::thread::Thread::new::thread_start::h62ca48b42d48a8fc
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys/unix/thread.rs:108:17
  72:     0x7f3d0b87eb43 - <unknown>
  73:     0x7f3d0b90fbb4 - __clone
  74:                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.65.0 (897e37553 2022-11-02) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `diesel::query_source::joins::Join<database::schema::message_threads::table, database::schema::listings::table, diesel::query_source::joins::Inner>: diesel::query_source::QuerySource`
#1 [typeck] type-checking `database::all_joined_message_threads`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
thread 'rustc' panicked at 'Failed to extract DefId: local_def_id_to_hir_id a87141d975409e8c-9a44ec8cde3aa19a', compiler/rustc_middle/src/dep_graph/dep_node.rs:267:17
stack backtrace:
   0:     0x7f3d0bb17d40 - std::backtrace_rs::backtrace::libunwind::trace::h32eb3e08e874dd27
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f3d0bb17d40 - std::backtrace_rs::backtrace::trace_unsynchronized::haa3f451d27bc11a5
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3d0bb17d40 - std::sys_common::backtrace::_print_fmt::h5b94a01bb4289bb5
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f3d0bb17d40 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb070b7fa7e3175df
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f3d0bb72bfe - core::fmt::write::hd5207aebbb9a86e9
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/fmt/mod.rs:1202:17
   5:     0x7f3d0bb08935 - std::io::Write::write_fmt::h3bd699bbd129ab8a
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/io/mod.rs:1679:15
   6:     0x7f3d0bb1a9f3 - std::sys_common::backtrace::_print::h7a21be552fdf58da
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f3d0bb1a9f3 - std::sys_common::backtrace::print::ha85c41fe4dd80b13
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f3d0bb1a9f3 - std::panicking::default_hook::{{closure}}::h04cca40023d0eeca
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:295:22
   9:     0x7f3d0bb1a6df - std::panicking::default_hook::haa3ca8c310ed5402
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:314:9
  10:     0x7f3d0e3482e1 - rustc_driver[cfb34b1539811fe8]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f3d0bb1b22d - std::panicking::rust_panic_with_hook::h7b190ce1a948faac
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:702:17
  12:     0x7f3d0bb1b087 - std::panicking::begin_panic_handler::{{closure}}::hbafbfdc3e1b97f68
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:588:13
  13:     0x7f3d0bb181ec - std::sys_common::backtrace::__rust_end_short_backtrace::hda93e5fef243b4c0
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f3d0bb1ada2 - rust_begin_unwind
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
  15:     0x7f3d0bb6f7d3 - core::panicking::panic_fmt::h8d17ca1073d9a733
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
  16:     0x7f3d0f365f61 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::dep_node::DepNode<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind> as rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepNodeExt>::extract_def_id::{closure#0}
  17:     0x7f3d0cc7ce3b - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::dep_node::DepNode<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind> as rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepNodeExt>::extract_def_id
  18:     0x7f3d0dc646bc - rustc_query_impl[d6191eea714bd250]::plumbing::force_from_dep_node::<rustc_query_impl[d6191eea714bd250]::queries::local_def_id_to_hir_id>
  19:     0x7f3d0cdce291 - <rustc_middle[a9ca1c3f9fd197cd]::ty::context::TyCtxt as rustc_query_system[860ed7b39cdfb46b]::dep_graph::DepContext>::try_force_from_dep_node
  20:     0x7f3d0cdcd022 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  21:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  22:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  23:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  24:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  25:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  26:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  27:     0x7f3d0cdccff0 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  28:     0x7f3d0d8220ca - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::get_query::<rustc_query_impl[d6191eea714bd250]::queries::evaluate_obligation, rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  29:     0x7f3d0d821235 - <rustc_query_impl[d6191eea714bd250]::Queries as rustc_middle[a9ca1c3f9fd197cd]::ty::query::QueryEngine>::evaluate_obligation
  30:     0x7f3d0cfe0937 - <rustc_trait_selection[f6cb7b5468c1337d]::traits::fulfill::FulfillProcessor as rustc_data_structures[62ce3989ce8140ee]::obligation_forest::ObligationProcessor>::process_obligation
  31:     0x7f3d0cfddd0f - <rustc_data_structures[62ce3989ce8140ee]::obligation_forest::ObligationForest<rustc_trait_selection[f6cb7b5468c1337d]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[f6cb7b5468c1337d]::traits::fulfill::FulfillProcessor, rustc_data_structures[62ce3989ce8140ee]::obligation_forest::Outcome<rustc_trait_selection[f6cb7b5468c1337d]::traits::fulfill::PendingPredicateObligation, rustc_infer[ed26b14e1208c12f]::traits::FulfillmentErrorCode>>
  32:     0x7f3d0cfdd816 - <rustc_trait_selection[f6cb7b5468c1337d]::traits::fulfill::FulfillmentContext as rustc_infer[ed26b14e1208c12f]::traits::engine::TraitEngine>::select_where_possible
  33:     0x7f3d0cf8a4b6 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  34:     0x7f3d0cf880a6 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  35:     0x7f3d0cf880a6 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  36:     0x7f3d0d02067f - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_argument_types
  37:     0x7f3d0cfd4f98 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_call
  38:     0x7f3d0cf87f27 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  39:     0x7f3d0d008d3b - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_match::{closure#0}
  40:     0x7f3d0cf89443 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  41:     0x7f3d0d02067f - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_argument_types
  42:     0x7f3d0cfd4f98 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_call
  43:     0x7f3d0cf87f27 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  44:     0x7f3d0cfcf97f - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  45:     0x7f3d0cf88050 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  46:     0x7f3d0d9824d6 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::check_return_expr
  47:     0x7f3d0d97a86a - rustc_typeck[4a3b2f91c49b3c3e]::check::check::check_fn
  48:     0x7f3d0d96da75 - <rustc_infer[ed26b14e1208c12f]::infer::InferCtxtBuilder>::enter::<&rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults, <rustc_typeck[4a3b2f91c49b3c3e]::check::inherited::InheritedBuilder>::enter<rustc_typeck[4a3b2f91c49b3c3e]::check::typeck_with_fallback<rustc_typeck[4a3b2f91c49b3c3e]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults>::{closure#0}>
  49:     0x7f3d0d96bc29 - rustc_typeck[4a3b2f91c49b3c3e]::check::typeck
  50:     0x7f3d0dc178ad - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[a9ca1c3f9fd197cd]::ty::context::TyCtxt, rustc_span[8f00505efff112e2]::def_id::LocalDefId, &rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults>
  51:     0x7f3d0dc0a664 - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::try_execute_query::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt, rustc_query_system[860ed7b39cdfb46b]::query::caches::DefaultCache<rustc_span[8f00505efff112e2]::def_id::LocalDefId, &rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults>>
  52:     0x7f3d0e284cae - <rustc_query_impl[d6191eea714bd250]::Queries as rustc_middle[a9ca1c3f9fd197cd]::ty::query::QueryEngine>::typeck
  53:     0x7f3d0e0c5057 - rustc_data_structures[62ce3989ce8140ee]::sync::par_for_each_in::<&[rustc_span[8f00505efff112e2]::def_id::LocalDefId], <rustc_middle[a9ca1c3f9fd197cd]::hir::map::Map>::par_body_owners<rustc_typeck[4a3b2f91c49b3c3e]::check::typeck_item_bodies::{closure#0}>::{closure#0}>
  54:     0x7f3d0e0c4e13 - rustc_typeck[4a3b2f91c49b3c3e]::check::typeck_item_bodies
  55:     0x7f3d0dfcf2e5 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[a9ca1c3f9fd197cd]::ty::context::TyCtxt, (), ()>
  56:     0x7f3d0dfce2be - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::try_execute_query::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt, rustc_query_system[860ed7b39cdfb46b]::query::caches::DefaultCache<(), ()>>
  57:     0x7f3d0dfcdcc7 - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::get_query::<rustc_query_impl[d6191eea714bd250]::queries::typeck_item_bodies, rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  58:     0x7f3d0d6bba9f - <rustc_session[c5946fac61f8bc34]::session::Session>::time::<(), rustc_typeck[4a3b2f91c49b3c3e]::check_crate::{closure#7}>
  59:     0x7f3d0d6bb65f - rustc_typeck[4a3b2f91c49b3c3e]::check_crate
  60:     0x7f3d0d6bac27 - rustc_interface[3182dd864eff9d7d]::passes::analysis
  61:     0x7f3d0e119382 - <rustc_query_system[860ed7b39cdfb46b]::dep_graph::graph::DepGraph<rustc_middle[a9ca1c3f9fd197cd]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[a9ca1c3f9fd197cd]::ty::context::TyCtxt, (), core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  62:     0x7f3d0e118a4a - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::try_execute_query::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt, rustc_query_system[860ed7b39cdfb46b]::query::caches::DefaultCache<(), core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>>
  63:     0x7f3d0e118517 - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::get_query::<rustc_query_impl[d6191eea714bd250]::queries::analysis, rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  64:     0x7f3d0d204897 - <rustc_interface[3182dd864eff9d7d]::passes::QueryContext>::enter::<rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  65:     0x7f3d0d1f828c - rustc_interface[3182dd864eff9d7d]::interface::create_compiler_and_run::<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>
  66:     0x7f3d0d1f6ac1 - <scoped_tls[e395fa6e23b19669]::ScopedKey<rustc_span[8f00505efff112e2]::SessionGlobals>>::set::<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  67:     0x7f3d0d1f67af - std[71cb4861428b0c25]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3182dd864eff9d7d]::util::run_in_thread_pool_with_globals<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  68:     0x7f3d0e1abd70 - <<std[71cb4861428b0c25]::thread::Builder>::spawn_unchecked_<rustc_interface[3182dd864eff9d7d]::util::run_in_thread_pool_with_globals<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#1} as core[8c92e53db3fc2eaa]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:     0x7f3d0bb25003 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h49f797984e2121bf
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/boxed.rs:1940:9
  70:     0x7f3d0bb25003 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hfa4f3d0ee6440e0b
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/boxed.rs:1940:9
  71:     0x7f3d0bb25003 - std::sys::unix::thread::Thread::new::thread_start::h62ca48b42d48a8fc
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys/unix/thread.rs:108:17
  72:     0x7f3d0b87eb43 - <unknown>
  73:     0x7f3d0b90fbb4 - __clone
  74:                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.65.0 (897e37553 2022-11-02) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `diesel::query_source::joins::Join<database::schema::reservations::table, database::schema::listings::table, diesel::query_source::joins::Inner>: diesel::query_source::QuerySource`
#1 [typeck] type-checking `database::all_joined_reservations`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `api`
```

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"vincenzopalazzo"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->