summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc/toggle-item-contents.rs
blob: 1f745043894ea8fa7a974c55e035f3788da93e68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#![allow(unused)]

// @has 'toggle_item_contents/struct.PubStruct.html'
// @count - '//details[@class="toggle type-contents-toggle"]' 0
pub struct PubStruct {
    pub a: usize,
    pub b: usize,
}

// @has 'toggle_item_contents/struct.BigPubStruct.html'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 13 fields'
pub struct BigPubStruct {
    pub a: usize,
    pub b: usize,
    pub c: usize,
    pub d: usize,
    pub e: usize,
    pub f: usize,
    pub g: usize,
    pub h: usize,
    pub i: usize,
    pub j: usize,
    pub k: usize,
    pub l: usize,
    pub m: usize,
}

// @has 'toggle_item_contents/union.BigUnion.html'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 13 fields'
pub union BigUnion {
    pub a: usize,
    pub b: usize,
    pub c: usize,
    pub d: usize,
    pub e: usize,
    pub f: usize,
    pub g: usize,
    pub h: usize,
    pub i: usize,
    pub j: usize,
    pub k: usize,
    pub l: usize,
    pub m: usize,
}

// @has 'toggle_item_contents/union.Union.html'
// @count - '//details[@class="toggle type-contents-toggle"]' 0
pub union Union {
    pub a: usize,
    pub b: usize,
    pub c: usize,
}

// @has 'toggle_item_contents/struct.PrivStruct.html'
// @count - '//details[@class="toggle type-contents-toggle"]' 0
// @has - '//pre[@class="rust item-decl"]' '/* private fields */'
pub struct PrivStruct {
    a: usize,
    b: usize,
}

// @has 'toggle_item_contents/enum.Enum.html'
// @!has - '//details[@class="toggle type-contents-toggle"]' ''
pub enum Enum {
    A, B, C,
    D {
        a: u8,
        b: u8
    }
}

// @has 'toggle_item_contents/enum.EnumStructVariant.html'
// @!has - '//details[@class="toggle type-contents-toggle"]' ''
pub enum EnumStructVariant {
    A, B, C,
    D {
        a: u8,
    }
}

// @has 'toggle_item_contents/enum.LargeEnum.html'
// @count - '//pre[@class="rust item-decl"]//details[@class="toggle type-contents-toggle"]' 1
// @has - '//pre[@class="rust item-decl"]//details[@class="toggle type-contents-toggle"]' 'Show 13 variants'
pub enum LargeEnum {
    A, B, C, D, E, F(u8), G, H, I, J, K, L, M
}

// @has 'toggle_item_contents/trait.Trait.html'
// @count - '//details[@class="toggle type-contents-toggle"]' 0
pub trait Trait {
    type A;
    #[must_use]
    fn foo();
    fn bar();
}

// @has 'toggle_item_contents/trait.GinormousTrait.html'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 16 associated items'
pub trait GinormousTrait {
    type A;
    type B;
    type C;
    type D;
    type E;
    type F;
    type G;
    type H;
    type I;
    type J;
    type K;
    type L;
    type M;
    const N: usize = 1;
    #[must_use]
    fn foo();
    fn bar();
}

// @has 'toggle_item_contents/trait.HugeTrait.html'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 12 associated constants and 2 methods'
pub trait HugeTrait {
    type A;
    const M: usize = 1;
    const N: usize = 1;
    const O: usize = 1;
    const P: usize = 1;
    const Q: usize = 1;
    const R: usize = 1;
    const S: usize = 1;
    const T: usize = 1;
    const U: usize = 1;
    const V: usize = 1;
    const W: usize = 1;
    const X: usize = 1;
    #[must_use]
    fn foo();
    fn bar();
}

// @has 'toggle_item_contents/trait.GiganticTrait.html'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 1 associated constant and 1 method'
pub trait GiganticTrait {
    type A;
    type B;
    type C;
    type D;
    type E;
    type F;
    type G;
    type H;
    type I;
    type J;
    type K;
    type L;
    const M: usize = 1;
    #[must_use]
    fn foo();
}

// @has 'toggle_item_contents/trait.BigTrait.html'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 14 methods'
pub trait BigTrait {
    type A;
    #[must_use]
    fn foo();
    fn bar();
    fn baz();
    fn quux();
    fn frob();
    fn greeble();
    fn blap();
    fn whoop();
    fn pow();
    fn bang();
    fn oomph();
    fn argh();
    fn wap();
    fn ouch();
}