rust/tests/ui/traits/trait-upcasting/normalization.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
390 B
Rust
Raw Normal View History

//@ check-pass
// issue: 114113
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
2023-12-14 06:11:28 -06:00
//@[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() {}