Repository: rust
Issue: rustc panic on docs build - thread 'rustc' panicked at 'forcing query with already existing `DepNode`
Labels: I-ICE,T-compiler,C-bug

The compiler fails 100% of the time on this branch: https://github.com/hoprnet/hoprnet/pull/5637

### Code

100% replicable in the branch.


### Meta
`rustc` from nix environment (local nix env generated rustc version)

`rustc --version --verbose`:
```
rustc 1.72.1 (d5c2e9c34 2023-09-13)
binary: rustc
commit-hash: d5c2e9c342b358556da91d61ed4133f6f50fc0c3
commit-date: 2023-09-13
host: x86_64-unknown-linux-gnu
release: 1.72.1
LLVM version: 16.0.5
```

### Error output

```
    Checking core-strategy v0.5.0 (/home/runner/work/hoprnet/hoprnet/packages/core/crates/core-strategy)
thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: Canonical { value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder { value: OutlivesPredicate(ReLateBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrAnon(None) }), ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), bound_vars: [] }, Binder { value: TraitPredicate(<Net as core_network::network::NetworkExternalActions>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<Db as std::clone::Clone>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<Db as core_ethereum_db::traits::HoprCoreEthereumDbActions>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<Net as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<Db as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder { value: OutlivesPredicate(promiscuous::PromiscuousStrategy<Db, Net>, ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), bound_vars: [] }, Binder { value: OutlivesPredicate(Db, ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), bound_vars: [] }, Binder { value: OutlivesPredicate(Net, ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), bound_vars: [] }], reveal: UserFacing, constness: NotConst }, value: Normalize { value: [async block@packages/core/crates/core-strategy/src/promiscuous.rs:303:43: 357: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) }] }
- dep-node: type_op_normalize_ty(cd86428122187af5-b25044893f3ebc89)', /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/compiler/rustc_query_system/src/dep_graph/graph.rs:351:9
stack backtrace:
   0:     0x7ffff3912b51 - std::backtrace_rs::backtrace::libunwind::trace::h66dc1c6acf794faa
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7ffff3912b51 - std::backtrace_rs::backtrace::trace_unsynchronized::ha80d20099a67f790
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7ffff3912b51 - std::sys_common::backtrace::_print_fmt::h7b959d43f35f16d4
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7ffff3912b51 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdaa196410d9ee0b9
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7ffff39796ff - core::fmt::rt::Argument::fmt::h0ddfbbe8be3f80d0
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/rt.rs:138:9
   5:     0x7ffff39796ff - core::fmt::write::h66b3c629f3d623e4
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/mod.rs:1094:21
   6:     0x7ffff3905497 - std::io::Write::write_fmt::hb6d80fba4115e0c2
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/io/mod.rs:1714:15
   7:     0x7ffff3912965 - std::sys_common::backtrace::_print::h1a49cfb0cf3cce17
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7ffff3912965 - std::sys_common::backtrace::print::hca95c2d0055e42a2
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7ffff3915743 - std::panicking::default_hook::{{closure}}::hc03c01c56bca600c
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:269:22
  10:     0x7ffff39154d4 - std::panicking::default_hook::hb2cb5315b6634f1c
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:288:9
  11:     0x7ffff6c6b60b - rustc_driver_impl[e91af841be79713a]::install_ice_hook::{closure#0}
  12:     0x7ffff3915f6e - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hb3a915ffd78277c6
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/alloc/src/boxed.rs:2007:9
  13:     0x7ffff3915f6e - std::panicking::rust_panic_with_hook::h75cd912a39a34e8a
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:709:13
  14:     0x7ffff3915cf7 - std::panicking::begin_panic_handler::{{closure}}::h1498b46f7849e167
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:597:13
  15:     0x7ffff3912fb6 - std::sys_common::backtrace::__rust_end_short_backtrace::hd36a39b27b98086b
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7ffff3915a42 - rust_begin_unwind
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:593:5
  17:     0x7ffff3975973 - core::panicking::panic_fmt::h98ef273141454c23
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/panicking.rs:67:14
  18:     0x7ffff6240a33 - rustc_query_system[8b63fd0ca5778b73]::query::plumbing::try_execute_query::<rustc_query_impl[e7af9ba2ee20c49a]::DynamicConfig<rustc_query_system[8b63fd0ca5778b73]::query::caches::DefaultCache<rustc_middle[fbd75b4db2cdb7e6]::infer::canonical::Canonical<rustc_middle[fbd75b4db2cdb7e6]::ty::ParamEnvAnd<rustc_middle[fbd75b4db2cdb7e6]::traits::query::type_op::Normalize<rustc_middle[fbd75b4db2cdb7e6]::ty::Ty>>>, rustc_middle[fbd75b4db2cdb7e6]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e7af9ba2ee20c49a]::plumbing::QueryCtxt, true>
  19:     0x7ffff623fd87 - rustc_query_impl[e7af9ba2ee20c49a]::query_impl::type_op_normalize_ty::get_query_incr::__rust_end_short_backtrace
  20:     0x7ffff5de1016 - <rustc_middle[fbd75b4db2cdb7e6]::ty::ParamEnvAnd<rustc_middle[fbd75b4db2cdb7e6]::traits::query::type_op::Normalize<rustc_middle[fbd75b4db2cdb7e6]::ty::Ty>> as rustc_trait_selection[3138a3dd55bba726]::traits::query::type_op::TypeOp>::fully_perform
  21:     0x7ffff5a261e5 - rustc_borrowck[5828231e0ff7c68]::type_check::free_region_relations::create
  22:     0x7ffff59f3d92 - rustc_borrowck[5828231e0ff7c68]::type_check::type_check
  23:     0x7ffff59ef7f4 - rustc_borrowck[5828231e0ff7c68]::nll::compute_regions
  24:     0x7ffff59ce4e6 - rustc_borrowck[5828231e0ff7c68]::do_mir_borrowck
  25:     0x7ffff59cc6c7 - rustc_borrowck[5828231e0ff7c68]::mir_borrowck
  26:     0x7ffff4c7401e - rustc_query_impl[e7af9ba2ee20c49a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e7af9ba2ee20c49a]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[fbd75b4db2cdb7e6]::query::erase::Erased<[u8; 8usize]>>
  27:     0x7ffff4c73fee - <rustc_query_impl[e7af9ba2ee20c49a]::query_impl::mir_borrowck::dynamic_query::{closure#2} as core[63ccc595abf60ca6]::ops::function::FnOnce<(rustc_middle[fbd75b4db2cdb7e6]::ty::context::TyCtxt, rustc_span[ca0c6fb73220b455]::def_id::LocalDefId)>>::call_once
  28:     0x7ffff5d50cc3 - rustc_query_system[8b63fd0ca5778b73]::query::plumbing::try_execute_query::<rustc_query_impl[e7af9ba2ee20c49a]::DynamicConfig<rustc_query_system[8b63fd0ca5778b73]::query::caches::VecCache<rustc_span[ca0c6fb73220b455]::def_id::LocalDefId, rustc_middle[fbd75b4db2cdb7e6]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e7af9ba2ee20c49a]::plumbing::QueryCtxt, true>
  29:     0x7ffff65b6359 - rustc_query_impl[e7af9ba2ee20c49a]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  30:     0x7ffff5df520f - <rustc_borrowck[5828231e0ff7c68]::type_check::TypeChecker>::prove_closure_bounds
  31:     0x7ffff5dbe734 - <rustc_borrowck[5828231e0ff7c68]::type_check::TypeChecker>::typeck_mir
  32:     0x7ffff59f424c - rustc_borrowck[5828231e0ff7c68]::type_check::type_check
  33:     0x7ffff59ef7f4 - rustc_borrowck[5828231e0ff7c68]::nll::compute_regions
  34:     0x7ffff59ce4e6 - rustc_borrowck[5828231e0ff7c68]::do_mir_borrowck
  35:     0x7ffff59cc6c7 - rustc_borrowck[5828231e0ff7c68]::mir_borrowck
  36:     0x7ffff4c7401e - rustc_query_impl[e7af9ba2ee20c49a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e7af9ba2ee20c49a]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[fbd75b4db2cdb7e6]::query::erase::Erased<[u8; 8usize]>>
  37:     0x7ffff4c73fee - <rustc_query_impl[e7af9ba2ee20c49a]::query_impl::mir_borrowck::dynamic_query::{closure#2} as core[63ccc595abf60ca6]::ops::function::FnOnce<(rustc_middle[fbd75b4db2cdb7e6]::ty::context::TyCtxt, rustc_span[ca0c6fb73220b455]::def_id::LocalDefId)>>::call_once
  38:     0x7ffff5d50cc3 - rustc_query_system[8b63fd0ca5778b73]::query::plumbing::try_execute_query::<rustc_query_impl[e7af9ba2ee20c49a]::DynamicConfig<rustc_query_system[8b63fd0ca5778b73]::query::caches::VecCache<rustc_span[ca0c6fb73220b455]::def_id::LocalDefId, rustc_middle[fbd75b4db2cdb7e6]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e7af9ba2ee20c49a]::plumbing::QueryCtxt, true>
  39:     0x7ffff65b6359 - rustc_query_impl[e7af9ba2ee20c49a]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  40:     0x7ffff60293de - rustc_data_structures[bf281432ed14a641]::sync::par_for_each_in::<&[rustc_span[ca0c6fb73220b455]::def_id::LocalDefId], <rustc_middle[fbd75b4db2cdb7e6]::hir::map::Map>::par_body_owners<rustc_interface[9522ab489a5f66e6]::passes::analysis::{closure#1}::{closure#0}>::{closure#0}>
  41:     0x7ffff60290d6 - <rustc_session[7bc6f0e7ff11a78e]::session::Session>::time::<(), rustc_interface[9522ab489a5f66e6]::passes::analysis::{closure#1}>
  42:     0x7ffff60287fe - rustc_interface[9522ab489a5f66e6]::passes::analysis
  43:     0x7ffff608f3ea - rustc_query_impl[e7af9ba2ee20c49a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e7af9ba2ee20c49a]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[fbd75b4db2cdb7e6]::query::erase::Erased<[u8; 1usize]>>
  44:     0x7ffff608f3d9 - <rustc_query_impl[e7af9ba2ee20c49a]::query_impl::analysis::dynamic_query::{closure#2} as core[63ccc595abf60ca6]::ops::function::FnOnce<(rustc_middle[fbd75b4db2cdb7e6]::ty::context::TyCtxt, ())>>::call_once
  45:     0x7ffff641117c - rustc_query_system[8b63fd0ca5778b73]::query::plumbing::try_execute_query::<rustc_query_impl[e7af9ba2ee20c49a]::DynamicConfig<rustc_query_system[8b63fd0ca5778b73]::query::caches::SingleCache<rustc_middle[fbd75b4db2cdb7e6]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[e7af9ba2ee20c49a]::plumbing::QueryCtxt, true>
  46:     0x7ffff6410d24 - rustc_query_impl[e7af9ba2ee20c49a]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  47:     0x7ffff61238e2 - <rustc_interface[9522ab489a5f66e6]::queries::QueryResult<&rustc_middle[fbd75b4db2cdb7e6]::ty::context::GlobalCtxt>>::enter::<core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>, rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}::{closure#2}::{closure#4}>
  48:     0x7ffff6122587 - <rustc_interface[9522ab489a5f66e6]::interface::Compiler>::enter::<rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}::{closure#2}, core[63ccc595abf60ca6]::result::Result<core[63ccc595abf60ca6]::option::Option<rustc_interface[9522ab489a5f66e6]::queries::Linker>, rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>
  49:     0x7ffff611f7b5 - rustc_span[ca0c6fb73220b455]::set_source_map::<core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>, rustc_interface[9522ab489a5f66e6]::interface::run_compiler<core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>, rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  50:     0x7ffff611f226 - <scoped_tls[35a2f59988e0a19c]::ScopedKey<rustc_span[ca0c6fb73220b455]::SessionGlobals>>::set::<rustc_interface[9522ab489a5f66e6]::interface::run_compiler<core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>, rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}>::{closure#0}, core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>
  51:     0x7ffff611e7ec - std[74d10c9f32099e86]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9522ab489a5f66e6]::util::run_in_thread_pool_with_globals<rustc_interface[9522ab489a5f66e6]::interface::run_compiler<core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>, rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}>::{closure#0}, core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>
  52:     0x7ffff64a53b5 - <<std[74d10c9f32099e86]::thread::Builder>::spawn_unchecked_<rustc_interface[9522ab489a5f66e6]::util::run_in_thread_pool_with_globals<rustc_interface[9522ab489a5f66e6]::interface::run_compiler<core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>, rustc_driver_impl[e91af841be79713a]::run_compiler::{closure#1}>::{closure#0}, core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[63ccc595abf60ca6]::result::Result<(), rustc_span[ca0c6fb73220b455]::ErrorGuaranteed>>::{closure#1} as core[63ccc595abf60ca6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  53:     0x7ffff3920425 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hde6e666388faa495
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/alloc/src/boxed.rs:1993:9
  54:     0x7ffff3920425 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9b6389e489a4842f
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/alloc/src/boxed.rs:1993:9
  55:     0x7ffff3920425 - std::sys::unix::thread::Thread::new::thread_start::hcab660740b858b1f
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys/unix/thread.rs:108:17
  56:     0x7ffff36b4dd4 - start_thread
  57:     0x7ffff37369b0 - __clone3
  58:                0x0 - <unknown>

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.72.1 (d5c2e9c34 2023-09-13) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type cdylib --crate-type rlib -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 [type_op_normalize_ty] normalizing `[async block@packages/core/crates/core-strategy/src/promiscuous.rs:303:43: 357:6]`
#1 [mir_borrowck] borrow-checking `promiscuous::<impl at packages/core/crates/core-strategy/src/promiscuous.rs:298:1: 298:64>::on_tick::{closure#0}`
#2 [mir_borrowck] borrow-checking `promiscuous::<impl at packages/core/crates/core-strategy/src/promiscuous.rs:298:1: 298:64>::on_tick`
#3 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `core-strategy` (lib)
warning: build failed, waiting for other jobs to finish...
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```

```

</p>
</details>