From 9044eb941a310e4120dab93a43e6630efef72e4a Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 20 Nov 2021 18:53:55 +0100 Subject: assert that dynamized traits are object-safe --- tests/doctests.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/doctests.md (limited to 'tests') 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; +} +``` -- cgit v1.2.3