aboutsummaryrefslogtreecommitdiff
path: root/tests/doctests.md
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-20 18:53:55 +0100
committerMartin Fischer <martin@push-f.com>2021-11-20 19:19:29 +0100
commit9044eb941a310e4120dab93a43e6630efef72e4a (patch)
tree40940640b1ace6a11a6b89ea04a0d70b1f67e38a /tests/doctests.md
parent3170127a4ef79c43018775934c7e0444dc828b2d (diff)
assert that dynamized traits are object-safe
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;
+}
+```