blob: 43cd773bf3ce66bdd11f8a8834dc3e47315708bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// check-pass
// compile-flags: -Ztrait-solver=next
#![feature(trait_upcasting)]
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() {}
|