Repository: rust
Issue: rustdoc: ICE: synthetic auto trait impls: `unexpected result when selecting […] obligation`
Labels: T-rustdoc,I-ICE,T-compiler,S-waiting-on-author,C-bug,A-synthetic-impls,A-auto-traits,S-needs-repro

<!--
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/

-->

Can't find a way to replicate this issue minimally, so here are the setup instructions.

### Setup

```shell
git clone git@github.com:interlay/interbtc.git
git checkout 73ddda2210618c3becd7682fdf2451090c45aec6
cargo doc --no-deps
```

### 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 1.68.0-nightly (b70baa4f9 2022-12-14)
binary: rustc
commit-hash: b70baa4f922a1809d79caeaeb902800c3be283b9
commit-date: 2022-12-14
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6
```

### Error output

```
thread 'rustc' panicked at 'Unexpected result when selecting types::AccountLiquidity<T> Obligation(predicate=Binder(ProjectionPredicate(AliasTy { substs: [T], def_id: DefId(20:346 ~ currency[66ce]::pallet::Config::Balance) }, Term::Ty(_)), []), depth=2)', compiler/rustc_trait_selection/src/traits/auto_trait.rs:762:33
stack backtrace:
   0:     0x7f157e84f7da - std::backtrace_rs::backtrace::libunwind::trace::h58c649c53097142b
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f157e84f7da - std::backtrace_rs::backtrace::trace_unsynchronized::h8a2218341115550a
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f157e84f7da - std::sys_common::backtrace::_print_fmt::hea4b2f7f6d570ca4
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f157e84f7da - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8d8d34f4e85c6a60
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f157e8b22ee - core::fmt::write::haf2065fc0d3659f4
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f157e83fb65 - std::io::Write::write_fmt::h6dce18c304ee54a2
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/io/mod.rs:1682:15
   6:     0x7f157e84f5a5 - std::sys_common::backtrace::_print::hec602170f4d3e048
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f157e84f5a5 - std::sys_common::backtrace::print::h8aa4a47604c83c88
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f157e8522ef - std::panicking::default_hook::{{closure}}::h68a2f001ac3644c4
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:267:22
   9:     0x7f157e85202b - std::panicking::default_hook::h4861c4cf633cd613
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:286:9
  10:     0x7f157e852b0c - std::panicking::rust_panic_with_hook::h404216ffd42d1a9f
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:688:13
  11:     0x7f157e8528a9 - std::panicking::begin_panic_handler::{{closure}}::hbfc6e95ed3b74164
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:579:13
  12:     0x7f157e84fc8c - std::sys_common::backtrace::__rust_end_short_backtrace::h6c2b4fdde46f911c
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7f157e8525b2 - rust_begin_unwind
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/std/src/panicking.rs:575:5
  14:     0x7f157e8aecd3 - core::panicking::panic_fmt::h52720972d063b41a
                               at /rustc/b70baa4f922a1809d79caeaeb902800c3be283b9/library/core/src/panicking.rs:64:14
  15:     0x7f157e269cc9 - <rustc_trait_selection[25d5237960b1166]::traits::auto_trait::AutoTraitFinder>::evaluate_predicates
  16:     0x55f311e33540 - <rustc_trait_selection[25d5237960b1166]::traits::auto_trait::AutoTraitFinder>::find_auto_trait_generics::<rustdoc[f79df397caf8daff]::clean::types::Generics, <rustdoc[f79df397caf8daff]::clean::auto_trait::AutoTraitFinder>::generate_for_trait::{closure#0}>
  17:     0x55f311d7bb69 - <rustdoc[f79df397caf8daff]::clean::auto_trait::AutoTraitFinder>::generate_for_trait
  18:     0x55f311d10fb7 - <alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::Item> as alloc[51c757b3bc4bb1d4]::vec::spec_from_iter::SpecFromIter<rustdoc[f79df397caf8daff]::clean::types::Item, core[a183604df3a39924]::iter::adapters::filter_map::FilterMap<alloc[51c757b3bc4bb1d4]::vec::into_iter::IntoIter<rustc_span[8d98255f5ee7a7e8]::def_id::DefId>, <rustdoc[f79df397caf8daff]::clean::auto_trait::AutoTraitFinder>::get_auto_trait_impls::{closure#0}>>>::from_iter
  19:     0x55f311d7c90e - <rustdoc[f79df397caf8daff]::clean::auto_trait::AutoTraitFinder>::get_auto_trait_impls
  20:     0x55f311c08475 - rustdoc[f79df397caf8daff]::clean::utils::get_auto_trait_and_blanket_impls
  21:     0x55f311e2ef32 - <rustdoc[f79df397caf8daff]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[f79df397caf8daff]::visit::DocVisitor>::visit_item
  22:     0x55f311e2f07a - <rustdoc[f79df397caf8daff]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[f79df397caf8daff]::visit::DocVisitor>::visit_item
  23:     0x55f311e2f07a - <rustdoc[f79df397caf8daff]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[f79df397caf8daff]::visit::DocVisitor>::visit_item
  24:     0x55f311e320c3 - <rustdoc[f79df397caf8daff]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[f79df397caf8daff]::visit::DocVisitor>::visit_crate
  25:     0x55f311db73ac - <rustc_session[f809e505f670defe]::session::Session>::time::<alloc[51c757b3bc4bb1d4]::vec::Vec<rustdoc[f79df397caf8daff]::clean::types::Item>, rustdoc[f79df397caf8daff]::passes::collect_trait_impls::collect_trait_impls::{closure#0}>
  26:     0x55f311e2cdc8 - rustdoc[f79df397caf8daff]::passes::collect_trait_impls::collect_trait_impls
  27:     0x55f311db760e - <rustc_session[f809e505f670defe]::session::Session>::time::<rustdoc[f79df397caf8daff]::clean::types::Crate, rustdoc[f79df397caf8daff]::core::run_global_ctxt::{closure#7}>
  28:     0x55f311e2a749 - rustdoc[f79df397caf8daff]::core::run_global_ctxt
  29:     0x55f311db8954 - <rustc_interface[59cd32f5a8db8a5b]::passes::QueryContext>::enter::<rustdoc[f79df397caf8daff]::main_args::{closure#1}::{closure#0}::{closure#1}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  30:     0x55f311c795fa - <rustc_interface[59cd32f5a8db8a5b]::interface::Compiler>::enter::<rustdoc[f79df397caf8daff]::main_args::{closure#1}::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  31:     0x55f311d50b3a - rustc_span[8d98255f5ee7a7e8]::with_source_map::<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustdoc[f79df397caf8daff]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  32:     0x55f311bdf795 - <scoped_tls[d2f689311b6a895]::ScopedKey<rustc_span[8d98255f5ee7a7e8]::SessionGlobals>>::set::<rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>, rustdoc[f79df397caf8daff]::main_args::{closure#1}>::{closure#0}, core[a183604df3a39924]::result::Result<(), rustc_errors[646af11ffc335ad2]::ErrorGuaranteed>>
  33:     0x55f311d638a0 - std[f8e68897caeb81ab]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[59cd32f5a8db8a5b]::util::run_in_thread_pool_with_globals<rustc_interface[59cd32f5a8db8a5b]::interface::run_compiler<core[a183604df3a39924]::result::Result<(), rustc_errors[646a
```