//@ run-pass //@ check-run-results #![feature(trait_upcasting)] // Test for . trait Supertrait { fn _print_numbers(&self, mem: &[usize; 100]) { println!("{mem:?}"); } } impl Supertrait for () {} trait Identity { type Selff; } impl Identity for Selff { type Selff = Selff; } trait Middle: Supertrait<()> + Supertrait { fn say_hello(&self, _: &usize) { println!("Hello!"); } } impl Middle for () {} trait Trait: Middle<<() as Identity>::Selff> {} impl Trait for () {} fn main() { (&() as &dyn Trait as &dyn Middle<()>).say_hello(&0); }