2023-07-05 21:53:21 -05:00
|
|
|
// compile-flags: -Ztrait-solver=next
|
|
|
|
// check-pass
|
|
|
|
|
2023-07-16 17:11:03 -05:00
|
|
|
#![feature(trait_upcasting)]
|
|
|
|
|
2023-07-05 21:53:21 -05:00
|
|
|
trait A {}
|
|
|
|
trait B: A {}
|
|
|
|
|
|
|
|
impl A for usize {}
|
|
|
|
impl B for usize {}
|
|
|
|
|
|
|
|
trait Mirror {
|
|
|
|
type Assoc: ?Sized;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: ?Sized> Mirror for T {
|
|
|
|
type Assoc = T;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = Box::new(1usize) as Box<<dyn B as Mirror>::Assoc>;
|
|
|
|
let y = x as Box<<dyn A as Mirror>::Assoc>;
|
|
|
|
}
|