//@ build-pass //@ revisions: current next //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver // Regression test for #135462. #![allow(coherence_leak_check)] type A = fn(&'static ()); type B = fn(&()); trait Bound: From> { } impl Bound for String {} trait Trt { fn __(&self, x: T) where T: Bound { T::from(()); } } impl Trt for S {} type GetAssoc = ::Ty; trait WithAssoc { type Ty; } impl WithAssoc for B { type Ty = String; } impl WithAssoc for A { type Ty = (); } fn main() { let x: &'static dyn Trt = &(); }