Skip to content

Commit

Permalink
Rollup merge of rust-lang#133721 - aDotInTheVoid:rdj-dyn-link, r=Guil…
Browse files Browse the repository at this point in the history
…laumeGomez

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

Found while investigating rust-lang#133719

Helps with rust-lang#81359

r? `@GuillaumeGomez`
  • Loading branch information
GuillaumeGomez authored Dec 2, 2024
2 parents 08f1f28 + b5d73fc commit 7fdbde0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/rustdoc-json/impls/trait-for-dyn-trait.rs
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7fdbde0

Please sign in to comment.