diff options
Diffstat (limited to 'tests/ui/traits/trait-upcasting/normalization.rs')
-rw-r--r-- | tests/ui/traits/trait-upcasting/normalization.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/traits/trait-upcasting/normalization.rs b/tests/ui/traits/trait-upcasting/normalization.rs new file mode 100644 index 000000000..c78338b0d --- /dev/null +++ b/tests/ui/traits/trait-upcasting/normalization.rs @@ -0,0 +1,20 @@ +// check-pass +// issue: 114113 +// revisions: current next +//[next] compile-flags: -Ztrait-solver=next + +#![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() {} |