diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/traits/next-solver/coerce-ambig-alias-to-rigid-alias.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/traits/next-solver/coerce-ambig-alias-to-rigid-alias.rs b/tests/ui/traits/next-solver/coerce-ambig-alias-to-rigid-alias.rs new file mode 100644 index 000000000..bcb48b5ac --- /dev/null +++ b/tests/ui/traits/next-solver/coerce-ambig-alias-to-rigid-alias.rs @@ -0,0 +1,15 @@ +// compile-flags: -Znext-solver +// check-pass + +trait Trait { + type Assoc; +} + +fn call<T: Trait>(_: <T as Trait>::Assoc, _: T) {} + +fn foo<T: Trait>(rigid: <T as Trait>::Assoc, t: T) { + // Check that we can coerce `<?0 as Trait>::Assoc` to `<T as Trait>::Assoc`. + call::<_ /* ?0 */>(rigid, t); +} + +fn main() {} |