blob: c03b5145aa73bf86d46407b522f0c4a9c35ad862 [file] [log] [blame]
//@ 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<P: WithAssoc>: From<GetAssoc<P>> {
}
impl Bound<B> for String {}
trait Trt<T> {
fn __(&self, x: T) where T: Bound<A> {
T::from(());
}
}
impl<T, S> Trt<T> for S {}
type GetAssoc<T> = <T as WithAssoc>::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<String> = &();
}