// compile-flags: -Znext-solver // check-pass #![feature(trait_upcasting)] trait A {} trait B: A {} impl A for usize {} impl B for usize {} trait Mirror { type Assoc: ?Sized; } impl Mirror for T { type Assoc = T; } fn main() { let x = Box::new(1usize) as Box<::Assoc>; let y = x as Box<::Assoc>; }