mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
21 lines
323 B
Rust
21 lines
323 B
Rust
// 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() {}
|