7985e4c7c3
Fix ICE in `diagnostic_hir_wf_check`
Fixes #87495. The [documentation for `ObligationCauseCode::WellFormed`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/traits/enum.ObligationCauseCode.html#variant.WellFormed) says that
> it is always correct [...] to specify `WellFormed(None)`
instead of `WellFormed(Some(...))`, which seems to have caused the issue here, as `diagnostic_hir_wf_check` does not expect to be called with an associated constant and will ICE:
fd853c00e2/compiler/rustc_typeck/src/hir_wf_check.rs (L131-L134)
Therefore, I have changed `check_associated_item()` to pass a `WellFormed(None)` for associated constants.
r? ``@Aaron1011``
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.