aboutsummaryrefslogtreecommitdiff
path: root/tests/doctests.md
diff options
context:
space:
mode:
Diffstat (limited to 'tests/doctests.md')
-rw-r--r--tests/doctests.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/doctests.md b/tests/doctests.md
new file mode 100644
index 0000000..ef557fe
--- /dev/null
+++ b/tests/doctests.md
@@ -0,0 +1,19 @@
+Tests that the object-safety assertion via `impl dyn` is working:
+
+```rust compile_fail
+trait ObjectUnsafe: Sized {}
+
+#[dynamize::dynamize]
+trait Trait: ObjectUnsafe {}
+```
+
+```rust compile_fail
+trait ObjectUnsafe: Sized {}
+
+#[dynamize::dynamize]
+trait Trait {
+ type A: ObjectUnsafe;
+
+ fn f(&self) -> Self::A;
+}
+```