@@ -8,18 +8,29 @@ extern crate cross_crate_generic_typedef;
88
99pub struct Adt ;
1010pub struct Ty ;
11+ pub struct TyCtxt ;
12+
13+ pub trait Interner {
14+ type Adt ;
15+ type Ty ;
16+ }
17+
18+ impl Interner for TyCtxt {
19+ type Adt = Adt ;
20+ type Ty = Ty ;
21+ }
1122
1223// @has 'inner_variants/type.AliasTy.html'
1324// @count - '//*[@id="variants"]' 0
1425// @count - '//*[@id="fields"]' 0
1526pub type AliasTy = Ty ;
1627
1728// @has 'inner_variants/enum.IrTyKind.html'
18- pub enum IrTyKind < A , B > {
29+ pub enum IrTyKind < A , I : Interner > {
1930 /// Doc comment for AdtKind
20- AdtKind ( A ) ,
31+ AdtKind ( I :: Adt ) ,
2132 /// and another one for TyKind
22- TyKind ( A , B ) ,
33+ TyKind ( I :: Adt , < I as Interner > :: Ty ) ,
2334 // no comment
2435 StructKind { a : A , } ,
2536 #[ doc( hidden) ]
@@ -29,14 +40,18 @@ pub enum IrTyKind<A, B> {
2940// @has 'inner_variants/type.NearlyTyKind.html'
3041// @count - '//*[@id="variants"]' 0
3142// @count - '//*[@id="fields"]' 0
32- pub type NearlyTyKind < B > = IrTyKind < Adt , B > ;
43+ pub type NearlyTyKind < A > = IrTyKind < A , TyCtxt > ;
3344
3445// @has 'inner_variants/type.TyKind.html'
3546// @count - '//*[@id="variants"]' 1
3647// @count - '//*[@id="fields"]' 0
3748// @count - '//*[@class="variant"]' 3
3849// @matches - '//details[@class="toggle"]//pre[@class="rust item-decl"]//code' "enum TyKind"
39- pub type TyKind = IrTyKind < Adt , Ty > ;
50+ // @has - '//details[@class="toggle"]//pre[@class="rust item-decl"]//code/a[1]' "Adt"
51+ // @has - '//details[@class="toggle"]//pre[@class="rust item-decl"]//code/a[2]' "Adt"
52+ // @has - '//details[@class="toggle"]//pre[@class="rust item-decl"]//code/a[3]' "Ty"
53+ // @has - '//details[@class="toggle"]//pre[@class="rust item-decl"]//code/a[4]' "i64"
54+ pub type TyKind = IrTyKind < i64 , TyCtxt > ;
4055
4156// @has 'inner_variants/union.OneOr.html'
4257pub union OneOr < A : Copy > {
@@ -68,13 +83,14 @@ pub type OneU64 = One<u64>;
6883
6984// @has 'inner_variants/struct.OnceA.html'
7085pub struct OnceA < ' a , A > {
71- a : & ' a A , // private
86+ pub a : & ' a A ,
7287}
7388
7489// @has 'inner_variants/type.Once.html'
7590// @count - '//*[@id="variants"]' 0
76- // @count - '//*[@id="fields"]' 0
91+ // @count - '//*[@id="fields"]' 1
7792// @matches - '//details[@class="toggle"]//pre[@class="rust item-decl"]//code' "struct Once<'a>"
93+ // @matches - '//details[@class="toggle"]//pre[@class="rust item-decl"]//code' "&'a"
7894pub type Once < ' a > = OnceA < ' a , i64 > ;
7995
8096// @has 'inner_variants/struct.HighlyGenericStruct.html'
0 commit comments