mirror of
https://github.com/rust-lang/rust.git
synced 2025-12-01 00:17:44 +00:00
This reverts commit 6d2b84b3ed7848fd91b8d6151d4451b3103ed816, reversing changes made to 73bc12199ea8c7651ed98b069c0dd6b0bb5fabcf.
21 lines
330 B
Rust
21 lines
330 B
Rust
// check-pass
|
|
// issue: 114113
|
|
// revisions: current next
|
|
//[next] compile-flags: -Znext-solver
|
|
|
|
#![feature(trait_upcasting)]
|
|
|
|
trait Mirror {
|
|
type Assoc;
|
|
}
|
|
impl<T> Mirror for T {
|
|
type Assoc = T;
|
|
}
|
|
|
|
trait Bar<T> {}
|
|
trait Foo<T>: Bar<<T as Mirror>::Assoc> {}
|
|
|
|
fn upcast<T>(x: &dyn Foo<T>) -> &dyn Bar<T> { x }
|
|
|
|
fn main() {}
|