]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-json/assoc_type.rs
Rollup merge of #107687 - cjgillot:sroa-2, r=oli-obk
[rust.git] / tests / rustdoc-json / assoc_type.rs
1 // Regression test for <https://github.com/rust-lang/rust/issues/98547>.
2
3 // @has "$.index[*][?(@.name=='Trait')]"
4 // @has "$.index[*][?(@.name=='AssocType')]"
5 // @has "$.index[*][?(@.name=='S')]"
6 // @has "$.index[*][?(@.name=='S2')]"
7
8 pub trait Trait {
9     type AssocType;
10 }
11
12 impl<T> Trait for T {
13     type AssocType = Self;
14 }
15
16 pub struct S;
17
18 /// Not needed for the #98547 ICE to occur, but added to maximize the chance of
19 /// getting an ICE in the future. See
20 /// <https://github.com/rust-lang/rust/pull/98548#discussion_r908219164>
21 pub struct S2;