summary refs log tree commit diff stats
path: root/tests/11-traits-generics-docs.rs
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2021-04-22 11:10:09 -0300
committerSoniEx2 <endermoneymod@gmail.com>2021-04-22 11:10:09 -0300
commita0f77cbba537514f84f64c5be660f2bdcd69782f (patch)
tree133abaff9d49703c27d6d3717361f2dfb3947905 /tests/11-traits-generics-docs.rs
parent36ca2f59cb1dbd6e63fafaddb76b25c260b44a98 (diff)
Fix things not being cleaned up correctly
Diffstat (limited to 'tests/11-traits-generics-docs.rs')
-rw-r--r--tests/11-traits-generics-docs.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/11-traits-generics-docs.rs b/tests/11-traits-generics-docs.rs
new file mode 100644
index 0000000..7d6ab6e
--- /dev/null
+++ b/tests/11-traits-generics-docs.rs
@@ -0,0 +1,28 @@
+// Checks that multiple `impl trait` in a row are valid, with generics and docs.
+
+use impl_trait::impl_trait;
+
+struct Foo<T>(T);
+trait Bar {
+}
+trait Baz {
+}
+
+impl_trait! {
+    impl<T> Foo<T> {
+        /// ABC
+        impl trait Bar {
+        }
+        /// DEF
+        impl trait Baz {
+        }
+    }
+}
+
+fn static_assert_1<T: Bar>(_t: T) {}
+fn static_assert_2<T: Baz>(_t: T) {}
+
+fn main() {
+    static_assert_1(Foo(()));
+    static_assert_2(Foo(()));
+}