Repository: rust
Issue: Rustc panic at 'forcing query with already existing `DepNode`'
Labels: I-ICE,T-compiler,C-bug

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->

### Code

Adding the supertrait caused the error, possibly I shouldn't do that :-)
```Rust
pub trait FeedbackHelper : std::fmt::Debug
where
    Self: Sized,
{
    fn matches_command_id(&self, wanted_command_id: &Uuid) -> bool;
    fn to_result(&self) -> ConfiguratorResult<Self>;
}
```
This `expect` was needing the Debug trait to be implemented for `FeedbackHelper`:
```Rust
...
        let (tx, rx) = oneshot::channel();
...
        tx.send(payload).expect("Could not send payload to master thread");
```

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
❯ rustc --version --verbose
rustc 1.72.0 (5680fa18f 2023-08-23)
binary: rustc
commit-hash: 5680fa18feaa87f3ff04063800aec256c3d4b4be
commit-date: 2023-08-23
host: x86_64-unknown-linux-gnu
release: 1.72.0
LLVM version: 16.0.5
```

### Error output

```
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
   Compiling configurator v0.1.0 (/home/samja/repos/tcs/confero-audio-configurator/configurator)
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(<entities::configuration::Configuration<P, S> as std::marker::Sync>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<entities::configuration::Configuration<P, S> as std::clone::Clone>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<entities::configuration::Configuration<P, S> as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<F as use_cases::configuration_service::FeedbackHelper>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<F as std::fmt::Debug>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<F as std::clone::Clone>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<F as std::cmp::PartialEq>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<F as std::marker::Sync>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<F as std::marker::Send>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<A as std::clone::Clone>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<A as std::cmp::PartialEq>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<A as std::marker::Sync>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<S as std::clone::Clone>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<S as std::cmp::PartialEq>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<S as std::marker::Sync>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<S as std::marker::Send>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<P as use_cases::configuration_service::ParameterHelpers>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<P as std::clone::Clone>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<P as std::cmp::PartialEq>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<P as std::marker::Sync>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<P as std::marker::Send>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<F as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<A as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<S as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<P as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder { value: OutlivesPredicate(use_cases::configuration_service::ConfigurationServiceImpl<P, S, A, F>, ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), bound_vars: [] }, Binder { value: OutlivesPredicate(P, ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), bound_vars: [] }, Binder { value: OutlivesPredicate(S, ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), bound_vars: [] }, Binder { value: OutlivesPredicate(A, ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), bound_vars: [] }, Binder { value: OutlivesPredicate(F, ReLateBound(DebruijnIndex(1), BoundRegion { var: 1, kind: BrAnon(None) })), bound_vars: [] }], reveal: UserFacing, constness: NotConst }, value: Normalize { value: [async block@configurator/src/use_cases/configuration_service.rs:162:58: 187: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(2b127dce9a934273-f3b696f833c21667)', /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/compiler/rustc_query_system/src/dep_graph/graph.rs:351:9
```

<!--
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>

```
stack backtrace:
   0:     0x7fd300162b61 - std::backtrace_rs::backtrace::libunwind::trace::he648b5c8dd376705
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fd300162b61 - std::backtrace_rs::backtrace::trace_unsynchronized::h5da3e203eef39e9f
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd300162b61 - std::sys_common::backtrace::_print_fmt::h8d28d3f20588ae4c
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fd300162b61 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd9a5b0c9c6b058c0
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fd3001c977f - core::fmt::rt::Argument::fmt::h0afc04119f252b53
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/fmt/rt.rs:138:9
   5:     0x7fd3001c977f - core::fmt::write::h50b1b3e73851a6fe
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/fmt/mod.rs:1094:21
   6:     0x7fd3001554a7 - std::io::Write::write_fmt::h184eaf275e4484f0
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/io/mod.rs:1714:15
   7:     0x7fd300162975 - std::sys_common::backtrace::_print::hf58c3a5a25090e71
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fd300162975 - std::sys_common::backtrace::print::hb9cf0a7c7f077819
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fd300165753 - std::panicking::default_hook::{{closure}}::h066adb2e3f3e2c07
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:269:22
  10:     0x7fd3001654e4 - std::panicking::default_hook::h277fa2776900ff14
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:288:9
  11:     0x7fd30346756b - <rustc_driver_impl[10725d833993dc31]::install_ice_hook::{closure#0} as core[f12ae36cc2e1ecf0]::ops::function::FnOnce<(&core[f12ae36cc2e1ecf0]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7fd300165f7e - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h09cad52ea08435f2
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/boxed.rs:2007:9
  13:     0x7fd300165f7e - std::panicking::rust_panic_with_hook::hceaf38da6d9db792
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:709:13
  14:     0x7fd300165d07 - std::panicking::begin_panic_handler::{{closure}}::h2bce3ed2516af7df
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:597:13
  15:     0x7fd300162fc6 - std::sys_common::backtrace::__rust_end_short_backtrace::h090f3faf8f98a395
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7fd300165a52 - rust_begin_unwind
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:593:5
  17:     0x7fd3001c59f3 - core::panicking::panic_fmt::h4ec8274704d163a3
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:67:14
  18:     0x7fd302a5da43 - rustc_query_system[5a9d202ec1d2890c]::query::plumbing::try_execute_query::<rustc_query_impl[7f6201a046a7a363]::DynamicConfig<rustc_query_system[5a9d202ec1d2890c]::query::caches::DefaultCache<rustc_middle[4cadb439cfabc8cf]::infer::canonical::Canonical<rustc_middle[4cadb439cfabc8cf]::ty::ParamEnvAnd<rustc_middle[4cadb439cfabc8cf]::traits::query::type_op::Normalize<rustc_middle[4cadb439cfabc8cf]::ty::Ty>>>, rustc_middle[4cadb439cfabc8cf]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7f6201a046a7a363]::plumbing::QueryCtxt, true>
  19:     0x7fd302a5cde3 - rustc_query_impl[7f6201a046a7a363]::query_impl::type_op_normalize_ty::get_query_incr::__rust_end_short_backtrace
  20:     0x7fd3024aace6 - <rustc_middle[4cadb439cfabc8cf]::ty::ParamEnvAnd<rustc_middle[4cadb439cfabc8cf]::traits::query::type_op::Normalize<rustc_middle[4cadb439cfabc8cf]::ty::Ty>> as rustc_trait_selection[ec0b3e5583b7dbc2]::traits::query::type_op::TypeOp>::fully_perform
  21:     0x7fd3020cd1d5 - rustc_borrowck[9ba73aa227b2b27]::type_check::free_region_relations::create
  22:     0x7fd302094f22 - rustc_borrowck[9ba73aa227b2b27]::type_check::type_check
  23:     0x7fd302090984 - rustc_borrowck[9ba73aa227b2b27]::nll::compute_regions
  24:     0x7fd302070147 - rustc_borrowck[9ba73aa227b2b27]::do_mir_borrowck
  25:     0x7fd30206e337 - rustc_borrowck[9ba73aa227b2b27]::mir_borrowck
  26:     0x7fd3014755de - rustc_query_impl[7f6201a046a7a363]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7f6201a046a7a363]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4cadb439cfabc8cf]::query::erase::Erased<[u8; 8usize]>>
  27:     0x7fd3014755ae - <rustc_query_impl[7f6201a046a7a363]::query_impl::mir_borrowck::dynamic_query::{closure#2} as core[f12ae36cc2e1ecf0]::ops::function::FnOnce<(rustc_middle[4cadb439cfabc8cf]::ty::context::TyCtxt, rustc_span[14af2d27fb997609]::def_id::LocalDefId)>>::call_once
  28:     0x7fd30219aa86 - rustc_query_system[5a9d202ec1d2890c]::query::plumbing::try_execute_query::<rustc_query_impl[7f6201a046a7a363]::DynamicConfig<rustc_query_system[5a9d202ec1d2890c]::query::caches::VecCache<rustc_span[14af2d27fb997609]::def_id::LocalDefId, rustc_middle[4cadb439cfabc8cf]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7f6201a046a7a363]::plumbing::QueryCtxt, true>
  29:     0x7fd302dc5479 - rustc_query_impl[7f6201a046a7a363]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  30:     0x7fd3024c954f - <rustc_borrowck[9ba73aa227b2b27]::type_check::TypeChecker>::prove_closure_bounds
  31:     0x7fd3024875bd - <rustc_borrowck[9ba73aa227b2b27]::type_check::TypeChecker>::typeck_mir
  32:     0x7fd3020953dc - rustc_borrowck[9ba73aa227b2b27]::type_check::type_check
  33:     0x7fd302090984 - rustc_borrowck[9ba73aa227b2b27]::nll::compute_regions
  34:     0x7fd302070147 - rustc_borrowck[9ba73aa227b2b27]::do_mir_borrowck
  35:     0x7fd30206e337 - rustc_borrowck[9ba73aa227b2b27]::mir_borrowck
  36:     0x7fd3014755de - rustc_query_impl[7f6201a046a7a363]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7f6201a046a7a363]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4cadb439cfabc8cf]::query::erase::Erased<[u8; 8usize]>>
  37:     0x7fd3014755ae - <rustc_query_impl[7f6201a046a7a363]::query_impl::mir_borrowck::dynamic_query::{closure#2} as core[f12ae36cc2e1ecf0]::ops::function::FnOnce<(rustc_middle[4cadb439cfabc8cf]::ty::context::TyCtxt, rustc_span[14af2d27fb997609]::def_id::LocalDefId)>>::call_once
  38:     0x7fd30219aa86 - rustc_query_system[5a9d202ec1d2890c]::query::plumbing::try_execute_query::<rustc_query_impl[7f6201a046a7a363]::DynamicConfig<rustc_query_system[5a9d202ec1d2890c]::query::caches::VecCache<rustc_span[14af2d27fb997609]::def_id::LocalDefId, rustc_middle[4cadb439cfabc8cf]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7f6201a046a7a363]::plumbing::QueryCtxt, true>
  39:     0x7fd302dc5479 - rustc_query_impl[7f6201a046a7a363]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  40:     0x7fd30282de2e - rustc_data_structures[cf1e21f3f9509cab]::sync::par_for_each_in::<&[rustc_span[14af2d27fb997609]::def_id::LocalDefId], <rustc_middle[4cadb439cfabc8cf]::hir::map::Map>::par_body_owners<rustc_interface[7e6a9899d53a1fe5]::passes::analysis::{closure#1}::{closure#0}>::{closure#0}>
  41:     0x7fd30282db26 - <rustc_session[c98e5f13e8087e38]::session::Session>::time::<(), rustc_interface[7e6a9899d53a1fe5]::passes::analysis::{closure#1}>
  42:     0x7fd30282d24e - rustc_interface[7e6a9899d53a1fe5]::passes::analysis
  43:     0x7fd30287dcfa - rustc_query_impl[7f6201a046a7a363]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7f6201a046a7a363]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4cadb439cfabc8cf]::query::erase::Erased<[u8; 1usize]>>
  44:     0x7fd30287dce9 - <rustc_query_impl[7f6201a046a7a363]::query_impl::analysis::dynamic_query::{closure#2} as core[f12ae36cc2e1ecf0]::ops::function::FnOnce<(rustc_middle[4cadb439cfabc8cf]::ty::context::TyCtxt, ())>>::call_once
  45:     0x7fd302c19d8c - rustc_query_system[5a9d202ec1d2890c]::query::plumbing::try_execute_query::<rustc_query_impl[7f6201a046a7a363]::DynamicConfig<rustc_query_system[5a9d202ec1d2890c]::query::caches::SingleCache<rustc_middle[4cadb439cfabc8cf]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[7f6201a046a7a363]::plumbing::QueryCtxt, true>
  46:     0x7fd302c19934 - rustc_query_impl[7f6201a046a7a363]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  47:     0x7fd30292ddf2 - <rustc_interface[7e6a9899d53a1fe5]::queries::QueryResult<&rustc_middle[4cadb439cfabc8cf]::ty::context::GlobalCtxt>>::enter::<core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>, rustc_driver_impl[10725d833993dc31]::run_compiler::{closure#1}::{closure#2}::{closure#4}>
  48:     0x7fd30292ca97 - <rustc_interface[7e6a9899d53a1fe5]::interface::Compiler>::enter::<rustc_driver_impl[10725d833993dc31]::run_compiler::{closure#1}::{closure#2}, core[f12ae36cc2e1ecf0]::result::Result<core[f12ae36cc2e1ecf0]::option::Option<rustc_interface[7e6a9899d53a1fe5]::queries::Linker>, rustc_span[14af2d27fb997609]::ErrorGuaranteed>>
  49:     0x7fd302929cc5 - rustc_span[14af2d27fb997609]::set_source_map::<core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>, rustc_interface[7e6a9899d53a1fe5]::interface::run_compiler<core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>, rustc_driver_impl[10725d833993dc31]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  50:     0x7fd302929736 - <scoped_tls[a7f541bbfecfca9d]::ScopedKey<rustc_span[14af2d27fb997609]::SessionGlobals>>::set::<rustc_interface[7e6a9899d53a1fe5]::interface::run_compiler<core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>, rustc_driver_impl[10725d833993dc31]::run_compiler::{closure#1}>::{closure#0}, core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>>
  51:     0x7fd302928cfc - std[7c7acd4e376d60d3]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7e6a9899d53a1fe5]::util::run_in_thread_pool_with_globals<rustc_interface[7e6a9899d53a1fe5]::interface::run_compiler<core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>, rustc_driver_impl[10725d833993dc31]::run_compiler::{closure#1}>::{closure#0}, core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>>
  52:     0x7fd302ca1305 - <<std[7c7acd4e376d60d3]::thread::Builder>::spawn_unchecked_<rustc_interface[7e6a9899d53a1fe5]::util::run_in_thread_pool_with_globals<rustc_interface[7e6a9899d53a1fe5]::interface::run_compiler<core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>, rustc_driver_impl[10725d833993dc31]::run_compiler::{closure#1}>::{closure#0}, core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f12ae36cc2e1ecf0]::result::Result<(), rustc_span[14af2d27fb997609]::ErrorGuaranteed>>::{closure#1} as core[f12ae36cc2e1ecf0]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  53:     0x7fd300170435 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc0b1022758ecac73
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/boxed.rs:1993:9
  54:     0x7fd300170435 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0c9654ebe7ad657e
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/alloc/src/boxed.rs:1993:9
  55:     0x7fd300170435 - std::sys::unix::thread::Thread::new::thread_start::h04c8e9c7d83d3bd5
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys/unix/thread.rs:108:17
  56:     0x7fd2fff13947 - start_thread
  57:     0x7fd2fff99870 - __clone3
  58:                0x0 - <unknown>```

</p>
</details>