4c2d6de70e
Aka trait_upcasting feature. And also adjust the `deref_into_dyn_supertrait` lint.
19 lines
293 B
Rust
19 lines
293 B
Rust
// check-pass
|
|
// compile-flags: -Ztrait-solver=next
|
|
|
|
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() {}
|