about summary refs log tree commit diff
path: root/tests/ui/methods/method-ambig-two-traits-from-impls.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/methods/method-ambig-two-traits-from-impls.rs')
-rw-r--r--tests/ui/methods/method-ambig-two-traits-from-impls.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/methods/method-ambig-two-traits-from-impls.rs b/tests/ui/methods/method-ambig-two-traits-from-impls.rs
new file mode 100644
index 00000000000..22bf8406605
--- /dev/null
+++ b/tests/ui/methods/method-ambig-two-traits-from-impls.rs
@@ -0,0 +1,16 @@
+trait A { fn foo(self); }
+trait B { fn foo(self); }
+
+struct AB {}
+
+impl A for AB {
+    fn foo(self) {}
+}
+
+impl B for AB {
+    fn foo(self) {}
+}
+
+fn main() {
+    AB {}.foo();  //~ ERROR E0034
+}