summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/trait-upcasting/normalization.rs
blob: 24da1ec5dfb58a52119469edf059df6cdad765c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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() {}