summary refs log tree commit diff stats
path: root/tests/06-impl-trait.rs
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2021-03-22 20:50:59 -0300
committerSoniEx2 <endermoneymod@gmail.com>2021-03-22 20:52:47 -0300
commit5bb562ad496f9ec42ec59abfe31d3576266c6a6d (patch)
tree4c792fcc67d4211c6c5b4a0e18ebb832b0d4ce66 /tests/06-impl-trait.rs
Initial commit
Diffstat (limited to 'tests/06-impl-trait.rs')
-rw-r--r--tests/06-impl-trait.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/06-impl-trait.rs b/tests/06-impl-trait.rs
new file mode 100644
index 0000000..ca0d2ee
--- /dev/null
+++ b/tests/06-impl-trait.rs
@@ -0,0 +1,20 @@
+// Checks that `impl trait` works.
+
+use impl_trait::impl_trait;
+
+struct Foo;
+trait Bar {
+}
+
+impl_trait! {
+    impl Foo {
+        impl trait Bar {
+        }
+    }
+}
+
+fn static_assert<T: Bar>(_t: T) {}
+
+fn main() {
+    static_assert(Foo);
+}