summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/09-multiple-traits.rs26
-rw-r--r--tests/progress.rs1
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/09-multiple-traits.rs b/tests/09-multiple-traits.rs
new file mode 100644
index 0000000..d75ab31
--- /dev/null
+++ b/tests/09-multiple-traits.rs
@@ -0,0 +1,26 @@
+// Checks that multiple `impl trait` in a row are valid.
+
+use impl_trait::impl_trait;
+
+struct Foo;
+trait Bar {
+}
+trait Baz {
+}
+
+impl_trait! {
+    impl Foo {
+        impl trait Bar {
+        }
+        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);
+}
diff --git a/tests/progress.rs b/tests/progress.rs
index aa42baa..22110b0 100644
--- a/tests/progress.rs
+++ b/tests/progress.rs
@@ -9,6 +9,7 @@ fn tests() {
     t.pass("tests/06-impl-trait.rs");
     t.pass("tests/07-docs.rs");
     t.pass("tests/08-inherent-docs.rs");
+    t.pass("tests/09-multiple-traits.rs");
     t.pass("tests/98-readme.rs");
     t.pass("tests/99-goal.rs");
 }