Skip to content

Commit 53034ea

Browse files
Add regression test for is_object_safe field on traits
1 parent c29f763 commit 53034ea

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![no_std]
2+
3+
// @has "$.index[*][?(@.name=='FooUnsafe')]"
4+
// @has "$.index[*][?(@.name=='FooUnsafe')].inner.trait.is_object_safe" false
5+
pub trait FooUnsafe {
6+
fn foo() -> Self;
7+
}
8+
9+
// @has "$.index[*][?(@.name=='BarUnsafe')]"
10+
// @has "$.index[*][?(@.name=='BarUnsafe')].inner.trait.is_object_safe" false
11+
pub trait BarUnsafe<T> {
12+
fn foo(i: T);
13+
}
14+
15+
// @has "$.index[*][?(@.name=='FooSafe')]"
16+
// @has "$.index[*][?(@.name=='FooSafe')].inner.trait.is_object_safe" true
17+
pub trait FooSafe {
18+
fn foo(&self);
19+
}

0 commit comments

Comments
 (0)