summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/coherence-treats-tait-ambig.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/coherence-treats-tait-ambig.rs')
-rw-r--r--tests/ui/impl-trait/coherence-treats-tait-ambig.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/coherence-treats-tait-ambig.rs b/tests/ui/impl-trait/coherence-treats-tait-ambig.rs
new file mode 100644
index 000000000..156a7eb0e
--- /dev/null
+++ b/tests/ui/impl-trait/coherence-treats-tait-ambig.rs
@@ -0,0 +1,19 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
+#![feature(type_alias_impl_trait)]
+
+type T = impl Sized;
+
+struct Foo;
+
+impl Into<T> for Foo {
+//~^ ERROR conflicting implementations of trait `Into<T>` for type `Foo`
+ fn into(self) -> T {
+ Foo
+ }
+}
+
+fn main() {
+ let _: T = Foo.into();
+}