summary refs log tree commit diff stats
path: root/tests/13-trait-generics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/13-trait-generics.rs')
-rw-r--r--tests/13-trait-generics.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/13-trait-generics.rs b/tests/13-trait-generics.rs
new file mode 100644
index 0000000..889d168
--- /dev/null
+++ b/tests/13-trait-generics.rs
@@ -0,0 +1,20 @@
+// Checks that the impl trait can have generics without the inherent impl having generics.
+
+use impl_trait::impl_trait;
+
+struct Foo;
+trait Bar<U> {
+}
+
+impl_trait! {
+    impl Foo {
+        impl trait<U> Bar<U> {
+        }
+    }
+}
+
+fn static_assert_1<T: Bar<U>, U>(_t: T, _u: U) {}
+
+fn main() {
+    static_assert_1(Foo, ());
+}