summary refs log tree commit diff stats
path: root/tests/12-combining-generics.rs
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2021-08-13 00:11:15 -0300
committerSoniEx2 <endermoneymod@gmail.com>2021-08-13 00:11:15 -0300
commitcf68dd857cd772b47dc46731c6bbb02112f07889 (patch)
tree86c6a971fe4d013701ea121b3bb3304d8154f0ae /tests/12-combining-generics.rs
parenta0f77cbba537514f84f64c5be660f2bdcd69782f (diff)
Make generics work in more places
Diffstat (limited to 'tests/12-combining-generics.rs')
-rw-r--r--tests/12-combining-generics.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/12-combining-generics.rs b/tests/12-combining-generics.rs
new file mode 100644
index 0000000..0401887
--- /dev/null
+++ b/tests/12-combining-generics.rs
@@ -0,0 +1,20 @@
+// Checks that the impl trait can have its own generics.
+
+use impl_trait::impl_trait;
+
+struct Foo<T>(T);
+trait Bar<U> {
+}
+
+impl_trait! {
+    impl<T> Foo<T> {
+        impl trait<U> Bar<U> {
+        }
+    }
+}
+
+fn static_assert_1<T: Bar<U>, U>(_t: T, _u: U) {}
+
+fn main() {
+    static_assert_1(Foo(()), ());
+}