Repository: rust
Issue: ICE: rustdoc: Cannot turn `UnevaluatedConst` into `AliasTy`
Labels: T-rustdoc,I-ICE,C-bug,F-associated_const_equality

<!--
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
`./assoc-const-AnonConst-ice-108220.rs`
```Rust
// ICE assertion failed: matches!(self.def_kind(ct.def.did), DefKind :: AnonConst)
// issue: rust-lang/rust#108220
//@ check-pass

#![feature(associated_const_equality)]
#![allow(unused)]

use std::marker::PhantomData;

pub struct NoPin;

pub trait SetAlternate<const A: u8> {}

impl SetAlternate<0> for NoPin {}

pub trait PinA<PER> {
    const A: u8;
}

impl<PER> PinA<PER> for NoPin {
    const A: u8 = 0;
}

pub trait Pins<USART> {}

impl<USART, T, const TA: u8> Pins<USART> for T where
    T: PinA<USART, A = { TA }> + SetAlternate<TA>
{
}

struct Serial<USART>(PhantomData<USART>);

impl<USART> Serial<USART> where NoPin: Pins<USART> {}

fn main() {}

```


### 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`:
```
rustdoc 1.80.0-nightly (ac385a5af 2024-05-14)
binary: rustdoc
commit-hash: ac385a5af6d9fa8399a0cec799833cd28324abf8
commit-date: 2024-05-14
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.4
```

### Error output

```
<output>
```

<!--
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>

```
thread 'rustc' panicked at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/compiler/rustc_type_ir/src/predicate.rs:423:17:
Cannot turn `UnevaluatedConst` into `AliasTy`
stack backtrace:
   0:     0x7e7ccb8cee55 - std::backtrace_rs::backtrace::libunwind::trace::h6c02ec5c4ae7a9ed
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7e7ccb8cee55 - std::backtrace_rs::backtrace::trace_unsynchronized::h4ab52472f673050f
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7e7ccb8cee55 - std::sys_common::backtrace::_print_fmt::hff16c7bf77867f2f
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7e7ccb8cee55 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf5bbd517a78a72c1
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7e7ccb91e16b - core::fmt::rt::Argument::fmt::ha0d61d125018a3d4
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/core/src/fmt/rt.rs:165:63
   5:     0x7e7ccb91e16b - core::fmt::write::hf8439f8783418e34
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/core/src/fmt/mod.rs:1169:21
   6:     0x7e7ccb8c3bef - std::io::Write::write_fmt::he6d30e3ac2c7ace1
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/io/mod.rs:1835:15
   7:     0x7e7ccb8cec2e - std::sys_common::backtrace::_print::hd550958f6da5ce7b
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7e7ccb8cec2e - std::sys_common::backtrace::print::h3192740e18906f86
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7e7ccb8d1649 - std::panicking::default_hook::{{closure}}::h4f96f38856da0e16
  10:     0x7e7ccb8d138d - std::panicking::default_hook::h7f7426c72bba8a0b
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/panicking.rs:298:9
  11:     0x7e7cc82f5190 - std[e4675fff21ee421e]::panicking::update_hook::<alloc[8cb67c63e553018c]::boxed::Box<rustc_driver_impl[bee7bb9cbfcc392b]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7e7ccb8d1d7b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h81ec2c7a19da648a
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/alloc/src/boxed.rs:2036:9
  13:     0x7e7ccb8d1d7b - std::panicking::rust_panic_with_hook::h76250522ff801f27
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/panicking.rs:799:13
  14:     0x7e7ccb8d1abb - std::panicking::begin_panic_handler::{{closure}}::h4289dee68346bd43
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/panicking.rs:656:13
  15:     0x7e7ccb8cf319 - std::sys_common::backtrace::__rust_end_short_backtrace::h92c3fe583cbe7556
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7e7ccb8d1827 - rust_begin_unwind
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/panicking.rs:652:5
  17:     0x7e7ccb91a733 - core::panicking::panic_fmt::hfa1fc4323659306b
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/core/src/panicking.rs:72:14
  18:     0x5b2909fd8479 - rustdoc[630b247c81594cca]::clean::clean_predicate
  19:     0x5b2909fde5d6 - rustdoc[630b247c81594cca]::clean::clean_ty_generics
  20:     0x5b2909fd0db0 - rustdoc[630b247c81594cca]::clean::utils::synthesize_auto_trait_and_blanket_impls
  21:     0x5b290a0e7a45 - <rustdoc[630b247c81594cca]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[630b247c81594cca]::visit::DocVisitor>::visit_item
  22:     0x5b290a0e7d7a - <rustdoc[630b247c81594cca]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[630b247c81594cca]::visit::DocVisitor>::visit_item
  23:     0x5b290a0e4595 - rustdoc[630b247c81594cca]::passes::collect_trait_impls::collect_trait_impls
  24:     0x5b2909ffefdb - rustdoc[630b247c81594cca]::core::run_global_ctxt
  25:     0x5b2909f0865f - <rustc_middle[f594d207a747ca53]::ty::context::GlobalCtxt>::enter::<rustdoc[630b247c81594cca]::main_args::{closure#1}::{closure#0}::{closure#0}, core[4a6535c84022c4d6]::result::Result<(), rustc_span[b9d313aa7d2576bf]::ErrorGuaranteed>>::{closure#1}
  26:     0x5b2909f11d14 - rustc_interface[cc0a2947afbb22f6]::interface::run_compiler::<core[4a6535c84022c4d6]::result::Result<(), rustc_span[b9d313aa7d2576bf]::ErrorGuaranteed>, rustdoc[630b247c81594cca]::main_args::{closure#1}>::{closure#1}
  27:     0x5b2909edafa5 - std[e4675fff21ee421e]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[cc0a2947afbb22f6]::util::run_in_thread_with_globals<rustc_interface[cc0a2947afbb22f6]::util::run_in_thread_pool_with_globals<rustc_interface[cc0a2947afbb22f6]::interface::run_compiler<core[4a6535c84022c4d6]::result::Result<(), rustc_span[b9d313aa7d2576bf]::ErrorGuaranteed>, rustdoc[630b247c81594cca]::main_args::{closure#1}>::{closure#1}, core[4a6535c84022c4d6]::result::Result<(), rustc_span[b9d313aa7d2576bf]::ErrorGuaranteed>>::{closure#0}, core[4a6535c84022c4d6]::result::Result<(), rustc_span[b9d313aa7d2576bf]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[4a6535c84022c4d6]::result::Result<(), rustc_span[b9d313aa7d2576bf]::ErrorGuaranteed>>
  28:     0x5b2909f1b2f7 - <<std[e4675fff21ee421e]::thread::Builder>::spawn_unchecked_<rustc_interface[cc0a2947afbb22f6]::util::run_in_thread_with_globals<rustc_interface[cc0a2947afbb22f6]::util::run_in_thread_pool_with_globals<rustc_interface[cc0a2947afbb22f6]::interface::run_compiler<core[4a6535c84022c4d6]::result::Result<(), rustc_span[b9d313aa7d2576bf]::ErrorGuaranteed>, rustdoc[630b247c81594cca]::main_args::{closure#1}>::{closure#1}, core[4a6535c84022c4d6]::result::Result<(), rustc_span[b9d313aa7d2576bf]::ErrorGuaranteed>>::{closure#0}, core[4a6535c84022c4d6]::result::Result<(), rustc_span[b9d313aa7d2576bf]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[4a6535c84022c4d6]::result::Result<(), rustc_span[b9d313aa7d2576bf]::ErrorGuaranteed>>::{closure#2} as core[4a6535c84022c4d6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  29:     0x7e7ccb8dbc1b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h38e55a1b3abff37e
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/alloc/src/boxed.rs:2022:9
  30:     0x7e7ccb8dbc1b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf28251f74a31db80
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/alloc/src/boxed.rs:2022:9
  31:     0x7e7ccb8dbc1b - std::sys::pal::unix::thread::Thread::new::thread_start::h9d29366f20710f1d
                               at /rustc/ac385a5af6d9fa8399a0cec799833cd28324abf8/library/std/src/sys/pal/unix/thread.rs:108:17
  32:     0x7e7cc50a955a - <unknown>
  33:     0x7e7cc5126a3c - <unknown>
  34:                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-rustdoc&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/tmp/im/rustc-ice-2024-05-14T18_19_16-550708.txt` to your bug report

query stack during panic:
end of query stack
```

</p>
</details>