//@ build-pass //@ revisions: current next //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver trait Foo {} impl Foo for fn(&'static ()) {} trait Bar { type Assoc: Default; } impl Bar for T { type Assoc = usize; } impl Bar for fn(&()) { type Assoc = (); } fn needs_foo() -> usize { needs_bar::() } fn needs_bar() -> ::Assoc { Default::default() } trait Evil { fn bad(&self) where T: Foo, { needs_foo::(); } } impl Evil for () {} fn main() { let x: &dyn Evil = &(); }