Rollup merge of #133721 - aDotInTheVoid:rdj-dyn-link, r=GuillaumeGomez

rustdoc-json: Add test for `impl Trait for dyn Trait`

Found while investigating #133719

Helps with #81359

r? `@GuillaumeGomez`
This commit is contained in:
Guillaume Gomez 2024-12-02 17:36:05 +01:00 committed by GitHub
commit 7fdbde0e18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,15 @@
//@ set t1 = '$.index[*][?(@.name=="T1")].id'
pub trait T1 {}
//@ set t2 = '$.index[*][?(@.name=="T2")].id'
pub trait T2 {}
/// Fun impl
impl T1 for dyn T2 {}
//@ set impl = '$.index[*][?(@.docs=="Fun impl")].id'
//@ is '$.index[*][?(@.name=="T1")].inner.trait.implementations[*]' $impl
//@ is '$.index[*][?(@.name=="T2")].inner.trait.implementations' []
//@ is '$.index[*][?(@.docs=="Fun impl")].inner.impl.trait.id' $t1
//@ is '$.index[*][?(@.docs=="Fun impl")].inner.impl.for.dyn_trait.traits[*].trait.id' $t2