//@ build-pass trait Supertrait { fn method(&self) {} } impl Supertrait for () {} trait WithAssoc { type Assoc; } trait Trait: Supertrait + Supertrait<()> {} fn upcast

(x: &dyn Trait

) -> &dyn Supertrait<()> { x } fn call

(x: &dyn Trait

) { x.method(); } fn main() { println!("{:p}", upcast::<()> as *const ()); println!("{:p}", call::<()> as *const ()); }