// check-fail #![feature(trait_upcasting)] trait Bar { fn bar(&self, _: T) {} } trait Foo: Bar + Bar { fn foo(&self, _: ()) {} } struct S; impl Bar for S {} impl Bar for S {} impl Foo for S {} fn main() { let s: &dyn Foo = &S; let t: &dyn Bar<_> = s; //~ ERROR mismatched types }