@@ -8,18 +8,29 @@ extern crate cross_crate_generic_typedef;
8
8
9
9
pub struct Adt ;
10
10
pub 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
+ }
11
22
12
23
// @has 'inner_variants/type.AliasTy.html'
13
24
// @count - '//*[@id="variants"]' 0
14
25
// @count - '//*[@id="fields"]' 0
15
26
pub type AliasTy = Ty ;
16
27
17
28
// @has 'inner_variants/enum.IrTyKind.html'
18
- pub enum IrTyKind < A , B > {
29
+ pub enum IrTyKind < A , I : Interner > {
19
30
/// Doc comment for AdtKind
20
- AdtKind ( A ) ,
31
+ AdtKind ( I :: Adt ) ,
21
32
/// and another one for TyKind
22
- TyKind ( A , B ) ,
33
+ TyKind ( I :: Adt , < I as Interner > :: Ty ) ,
23
34
// no comment
24
35
StructKind { a : A , } ,
25
36
#[ doc( hidden) ]
@@ -29,14 +40,18 @@ pub enum IrTyKind<A, B> {
29
40
// @has 'inner_variants/type.NearlyTyKind.html'
30
41
// @count - '//*[@id="variants"]' 0
31
42
// @count - '//*[@id="fields"]' 0
32
- pub type NearlyTyKind < B > = IrTyKind < Adt , B > ;
43
+ pub type NearlyTyKind < A > = IrTyKind < A , TyCtxt > ;
33
44
34
45
// @has 'inner_variants/type.TyKind.html'
35
46
// @count - '//*[@id="variants"]' 1
36
47
// @count - '//*[@id="fields"]' 0
37
48
// @count - '//*[@class="variant"]' 3
38
49
// @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 > ;
40
55
41
56
// @has 'inner_variants/union.OneOr.html'
42
57
pub union OneOr < A : Copy > {
@@ -68,13 +83,14 @@ pub type OneU64 = One<u64>;
68
83
69
84
// @has 'inner_variants/struct.OnceA.html'
70
85
pub struct OnceA < ' a , A > {
71
- a : & ' a A , // private
86
+ pub a : & ' a A ,
72
87
}
73
88
74
89
// @has 'inner_variants/type.Once.html'
75
90
// @count - '//*[@id="variants"]' 0
76
- // @count - '//*[@id="fields"]' 0
91
+ // @count - '//*[@id="fields"]' 1
77
92
// @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"
78
94
pub type Once < ' a > = OnceA < ' a , i64 > ;
79
95
80
96
// @has 'inner_variants/struct.HighlyGenericStruct.html'
0 commit comments