Repository: rust
Issue: compiler crashed on cargo build
Labels: I-ICE,T-compiler,A-incr-comp,C-bug


<details><summary><strong>Backtrace</strong></summary>
<p>

```
thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: Canonical { value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrAnon(None) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 2, kind: BrAnon(None) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 3, kind: BrAnon(None) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 4, kind: BrAnon(None) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), []), Binder(OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 5, kind: BrAnon(None) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), []), Binder(TraitPredicate(<Self as gateway::MxMarketDataConnection>, polarity:Positive), []), Binder(TraitPredicate(<Self as std::marker::Send>, polarity:Positive), []), Binder(TraitPredicate(<Self as gateway::MxDataConnection>, polarity:Positive), []), Binder(OutlivesPredicate(Self, ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), [])], reveal: UserFacing, constness: NotConst }, value: Normalize { value: [async block@mx/mx-core/src/gateway.rs:429:7: 497:6] } }, max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }] }
- dep-node: type_op_normalize_ty(ee4d458c54ea5d4d-d78035af697b6cc6)', /rustc/90c541806f23a127002de5b4038be731ba1458ca/compiler/rustc_query_system/src/dep_graph/graph.rs:350:9
stack backtrace:
   0:        0x1032e1864 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h819e9cbdf1a9e730
   1:        0x103334958 - core::fmt::write::ha5e9bf3131ecb7c0
   2:        0x1032d7214 - std::io::Write::write_fmt::h414ce9994bf17404
   3:        0x1032e1678 - std::sys_common::backtrace::print::h8072db0bbd5bcc3d
   4:        0x1032e408c - std::panicking::default_hook::{{closure}}::h2c85c5b0c2ede151
   5:        0x1032e3e4c - std::panicking::default_hook::hcf2f70992d02f6fe
   6:        0x10b7dc058 - rustc_driver_impl[783dc85a9905d0e5]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x1032e474c - std::panicking::rust_panic_with_hook::h023af7f90b47eb8b
   8:        0x1032e4544 - std::panicking::begin_panic_handler::{{closure}}::h14283519edc1d634
   9:        0x1032e1c84 - std::sys_common::backtrace::__rust_end_short_backtrace::hc366c0b0cef5b747
  10:        0x1032e42d8 - _rust_begin_unwind
  11:        0x103360400 - core::panicking::panic_fmt::h324f50b29db90195
  12:        0x10ea6c644 - <std[bf9110f564f42f12]::thread::local::LocalKey<core[b2c7346eda96f041]::cell::Cell<*const ()>>>::with::<rustc_middle[51dfd5d9279e1028]::ty::context::tls::enter_context<rustc_query_system[a624e6a9fe4584df]::query::plumbing::execute_job_incr<rustc_query_impl[7b60fd99fe06ff81]::queries::type_op_normalize_ty, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>
  13:        0x10e97dca0 - rustc_query_system[a624e6a9fe4584df]::query::plumbing::try_execute_query::<rustc_query_impl[7b60fd99fe06ff81]::queries::type_op_normalize_ty, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>
  14:        0x10ebc3674 - <rustc_query_impl[7b60fd99fe06ff81]::Queries as rustc_middle[51dfd5d9279e1028]::ty::query::QueryEngine>::type_op_normalize_ty
  15:        0x10f40d664 - <rustc_middle[51dfd5d9279e1028]::ty::Ty as rustc_trait_selection[6522095af789f87a]::traits::query::type_op::normalize::Normalizable>::type_op_method
  16:        0x10e53c55c - <rustc_middle[51dfd5d9279e1028]::traits::query::type_op::Normalize<rustc_middle[51dfd5d9279e1028]::ty::Ty> as rustc_trait_selection[6522095af789f87a]::traits::query::type_op::QueryTypeOp>::fully_perform_into
  17:        0x10e672ca0 - <rustc_middle[51dfd5d9279e1028]::ty::ParamEnvAnd<rustc_middle[51dfd5d9279e1028]::traits::query::type_op::Normalize<rustc_middle[51dfd5d9279e1028]::ty::Ty>> as rustc_trait_selection[6522095af789f87a]::traits::query::type_op::TypeOp>::fully_perform
  18:        0x10e60c79c - rustc_borrowck[3cbad71922bf7c4a]::type_check::free_region_relations::create
  19:        0x10e5a1314 - rustc_borrowck[3cbad71922bf7c4a]::nll::compute_regions
  20:        0x10e4edb10 - rustc_borrowck[3cbad71922bf7c4a]::do_mir_borrowck
  21:        0x10e4e4f90 - rustc_borrowck[3cbad71922bf7c4a]::mir_borrowck
  22:        0x10e4c9388 - <rustc_borrowck[3cbad71922bf7c4a]::provide::{closure#0} as core[b2c7346eda96f041]::ops::function::FnOnce<(rustc_middle[51dfd5d9279e1028]::ty::context::TyCtxt, rustc_span[350718d478b9eefa]::def_id::LocalDefId)>>::call_once
  23:        0x10ea1ee68 - <std[bf9110f564f42f12]::thread::local::LocalKey<core[b2c7346eda96f041]::cell::Cell<*const ()>>>::with::<rustc_middle[51dfd5d9279e1028]::ty::context::tls::enter_context<rustc_query_system[a624e6a9fe4584df]::query::plumbing::execute_job_incr<rustc_query_impl[7b60fd99fe06ff81]::queries::mir_borrowck, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>
  24:        0x10e940698 - rustc_query_system[a624e6a9fe4584df]::query::plumbing::try_execute_query::<rustc_query_impl[7b60fd99fe06ff81]::queries::mir_borrowck, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>
  25:        0x10ebb3018 - <rustc_query_impl[7b60fd99fe06ff81]::Queries as rustc_middle[51dfd5d9279e1028]::ty::query::QueryEngine>::mir_borrowck
  26:        0x10e5a9934 - <rustc_borrowck[3cbad71922bf7c4a]::type_check::TypeChecker>::prove_closure_bounds
  27:        0x10e5ad810 - <rustc_borrowck[3cbad71922bf7c4a]::type_check::TypeChecker>::check_rvalue
  28:        0x10e5b0e34 - <rustc_borrowck[3cbad71922bf7c4a]::type_check::TypeChecker>::typeck_mir
  29:        0x10e5a16c8 - rustc_borrowck[3cbad71922bf7c4a]::nll::compute_regions
  30:        0x10e4edb10 - rustc_borrowck[3cbad71922bf7c4a]::do_mir_borrowck
  31:        0x10e4e4f90 - rustc_borrowck[3cbad71922bf7c4a]::mir_borrowck
  32:        0x10e4c9388 - <rustc_borrowck[3cbad71922bf7c4a]::provide::{closure#0} as core[b2c7346eda96f041]::ops::function::FnOnce<(rustc_middle[51dfd5d9279e1028]::ty::context::TyCtxt, rustc_span[350718d478b9eefa]::def_id::LocalDefId)>>::call_once
  33:        0x10ea1ee68 - <std[bf9110f564f42f12]::thread::local::LocalKey<core[b2c7346eda96f041]::cell::Cell<*const ()>>>::with::<rustc_middle[51dfd5d9279e1028]::ty::context::tls::enter_context<rustc_query_system[a624e6a9fe4584df]::query::plumbing::execute_job_incr<rustc_query_impl[7b60fd99fe06ff81]::queries::mir_borrowck, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>
  34:        0x10e940698 - rustc_query_system[a624e6a9fe4584df]::query::plumbing::try_execute_query::<rustc_query_impl[7b60fd99fe06ff81]::queries::mir_borrowck, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>
  35:        0x10ebb3018 - <rustc_query_impl[7b60fd99fe06ff81]::Queries as rustc_middle[51dfd5d9279e1028]::ty::query::QueryEngine>::mir_borrowck
  36:        0x10b89baa4 - <core[b2c7346eda96f041]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[b0ef732b28d74439]::sync::par_for_each_in<&[rustc_span[350718d478b9eefa]::def_id::LocalDefId], <rustc_middle[51dfd5d9279e1028]::hir::map::Map>::par_body_owners<rustc_interface[86097f894d44157]::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}> as core[b2c7346eda96f041]::ops::function::FnOnce<()>>::call_once
  37:        0x10b87b160 - rustc_data_structures[b0ef732b28d74439]::sync::par_for_each_in::<&[rustc_span[350718d478b9eefa]::def_id::LocalDefId], <rustc_middle[51dfd5d9279e1028]::hir::map::Map>::par_body_owners<rustc_interface[86097f894d44157]::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
  38:        0x10b882e04 - <rustc_session[fcd7c20a0454c43b]::session::Session>::time::<(), rustc_interface[86097f894d44157]::passes::analysis::{closure#2}>
  39:        0x10b8f650c - rustc_interface[86097f894d44157]::passes::analysis
  40:        0x10eaad1c8 - <std[bf9110f564f42f12]::thread::local::LocalKey<core[b2c7346eda96f041]::cell::Cell<*const ()>>>::with::<rustc_middle[51dfd5d9279e1028]::ty::context::tls::enter_context<rustc_query_system[a624e6a9fe4584df]::query::plumbing::execute_job_incr<rustc_query_impl[7b60fd99fe06ff81]::queries::analysis, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>
  41:        0x10e9b3298 - rustc_query_system[a624e6a9fe4584df]::query::plumbing::try_execute_query::<rustc_query_impl[7b60fd99fe06ff81]::queries::analysis, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>
  42:        0x10eba8998 - <rustc_query_impl[7b60fd99fe06ff81]::Queries as rustc_middle[51dfd5d9279e1028]::ty::query::QueryEngine>::analysis
  43:        0x10b824c28 - <std[bf9110f564f42f12]::thread::local::LocalKey<core[b2c7346eda96f041]::cell::Cell<*const ()>>>::with::<rustc_middle[51dfd5d9279e1028]::ty::context::tls::enter_context<<rustc_middle[51dfd5d9279e1028]::ty::context::GlobalCtxt>::enter<rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>
  44:        0x10b7f05d4 - <rustc_interface[86097f894d44157]::queries::QueryResult<&rustc_middle[51dfd5d9279e1028]::ty::context::GlobalCtxt>>::enter::<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}::{closure#2}::{closure#4}>
  45:        0x10b82ca24 - <rustc_interface[86097f894d44157]::interface::Compiler>::enter::<rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}::{closure#2}, core[b2c7346eda96f041]::result::Result<core[b2c7346eda96f041]::option::Option<rustc_interface[86097f894d44157]::queries::Linker>, rustc_span[350718d478b9eefa]::ErrorGuaranteed>>
  46:        0x10b7e32cc - rustc_span[350718d478b9eefa]::set_source_map::<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_interface[86097f894d44157]::interface::run_compiler<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  47:        0x10b7f68a8 - std[bf9110f564f42f12]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[86097f894d44157]::util::run_in_thread_pool_with_globals<rustc_interface[86097f894d44157]::interface::run_compiler<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}>::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>
  48:        0x10b7e7a78 - <<std[bf9110f564f42f12]::thread::Builder>::spawn_unchecked_<rustc_interface[86097f894d44157]::util::run_in_thread_pool_with_globals<rustc_interface[86097f894d44157]::interface::run_compiler<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}>::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#1} as core[b2c7346eda96f041]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:        0x1032ecdf4 - std::sys::unix::thread::Thread::new::thread_start::h7f56b35fafcfec87
  50:        0x1a9023fa8 - __pthread_joiner_wake

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.70.0 (90c541806 2023-05-31) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C linker-plugin-lto -C split-debuginfo=unpacked -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [type_op_normalize_ty] normalizing `[async block@mx/mx-core/src/gateway.rs:429:7: 497:6]`
#1 [mir_borrowck] borrow-checking `gateway::MxMarketDataConnection::resubscribe_orderbooks::{closure#0}`
#2 [mir_borrowck] borrow-checking `gateway::MxMarketDataConnection::resubscribe_orderbooks`
#3 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `mx-core` (lib)
```

</p>
</details>