diff --git a/tests/rustdoc-json/traits/is_object_safe.rs b/tests/rustdoc-json/traits/is_object_safe.rs new file mode 100644 index 00000000000..131c5fc57a5 --- /dev/null +++ b/tests/rustdoc-json/traits/is_object_safe.rs @@ -0,0 +1,19 @@ +#![no_std] + +// @has "$.index[*][?(@.name=='FooUnsafe')]" +// @is "$.index[*][?(@.name=='FooUnsafe')].inner.trait.is_object_safe" false +pub trait FooUnsafe { + fn foo() -> Self; +} + +// @has "$.index[*][?(@.name=='BarUnsafe')]" +// @is "$.index[*][?(@.name=='BarUnsafe')].inner.trait.is_object_safe" false +pub trait BarUnsafe { + fn foo(i: T); +} + +// @has "$.index[*][?(@.name=='FooSafe')]" +// @is "$.index[*][?(@.name=='FooSafe')].inner.trait.is_object_safe" true +pub trait FooSafe { + fn foo(&self); +}