2024-02-16 14:02:50 -06:00
|
|
|
//@ check-pass
|
|
|
|
//@ compile-flags: -Znext-solver
|
2024-01-22 06:23:50 -06:00
|
|
|
#![feature(trait_upcasting)]
|
2023-07-07 15:42:37 -05:00
|
|
|
|
|
|
|
pub trait A {}
|
|
|
|
pub trait B: A {}
|
|
|
|
|
|
|
|
pub trait Mirror {
|
|
|
|
type Assoc: ?Sized;
|
|
|
|
}
|
|
|
|
impl<T: ?Sized> Mirror for T {
|
|
|
|
type Assoc = T;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn foo<'a>(x: &'a <dyn B + 'static as Mirror>::Assoc) -> &'a (dyn A + 'static) {
|
|
|
|
x
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|