Skip to content

Commit b5d73fc

Browse files
committed
rustdoc-json: Add test for impl Trait for dyn Trait
1 parent 1555074 commit b5d73fc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ set t1 = '$.index[*][?(@.name=="T1")].id'
2+
pub trait T1 {}
3+
4+
//@ set t2 = '$.index[*][?(@.name=="T2")].id'
5+
pub trait T2 {}
6+
7+
/// Fun impl
8+
impl T1 for dyn T2 {}
9+
10+
//@ set impl = '$.index[*][?(@.docs=="Fun impl")].id'
11+
//@ is '$.index[*][?(@.name=="T1")].inner.trait.implementations[*]' $impl
12+
//@ is '$.index[*][?(@.name=="T2")].inner.trait.implementations' []
13+
14+
//@ is '$.index[*][?(@.docs=="Fun impl")].inner.impl.trait.id' $t1
15+
//@ is '$.index[*][?(@.docs=="Fun impl")].inner.impl.for.dyn_trait.traits[*].trait.id' $t2

0 commit comments

Comments
 (0)