Skip to content

Commit

Permalink
Add regression test for is_object_safe field on traits
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Dec 23, 2023
1 parent c29f763 commit 53034ea
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/rustdoc-json/traits/is_object_safe.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#![no_std]

// @has "$.index[*][?(@.name=='FooUnsafe')]"
// @has "$.index[*][?(@.name=='FooUnsafe')].inner.trait.is_object_safe" false
pub trait FooUnsafe {
fn foo() -> Self;
}

// @has "$.index[*][?(@.name=='BarUnsafe')]"
// @has "$.index[*][?(@.name=='BarUnsafe')].inner.trait.is_object_safe" false
pub trait BarUnsafe<T> {
fn foo(i: T);
}

// @has "$.index[*][?(@.name=='FooSafe')]"
// @has "$.index[*][?(@.name=='FooSafe')].inner.trait.is_object_safe" true
pub trait FooSafe {
fn foo(&self);
}

0 comments on commit 53034ea

Please sign in to comment.