summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/impl-generic-mismatch-ab.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/impl-generic-mismatch-ab.rs')
-rw-r--r--tests/ui/impl-trait/impl-generic-mismatch-ab.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/impl-generic-mismatch-ab.rs b/tests/ui/impl-trait/impl-generic-mismatch-ab.rs
new file mode 100644
index 000000000..6c9b119de
--- /dev/null
+++ b/tests/ui/impl-trait/impl-generic-mismatch-ab.rs
@@ -0,0 +1,12 @@
+use std::fmt::Debug;
+
+trait Foo {
+ fn foo<A: Debug>(&self, a: &A, b: &impl Debug);
+}
+
+impl Foo for () {
+ fn foo<B: Debug>(&self, a: &impl Debug, b: &B) { }
+ //~^ ERROR method `foo` has an incompatible type for trait
+}
+
+fn main() {}