rust/tests/ui/traits/trait-upcasting/normalization.rs
2024-02-16 20:02:50 +00:00

21 lines
333 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() {}