]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/item-hide-threshold.rs
rustdoc: use details tag for trait implementors
[rust.git] / src / test / rustdoc / item-hide-threshold.rs
1 #![allow(unused)]
2
3 // @has 'item_hide_threshold/struct.PubStruct.html'
4 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
5 pub struct PubStruct {
6     pub a: usize,
7     pub b: usize,
8 }
9
10 // @has 'item_hide_threshold/struct.BigPubStruct.html'
11 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
12 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show fields'
13 pub struct BigPubStruct {
14     pub a: usize,
15     pub b: usize,
16     pub c: usize,
17     pub d: usize,
18     pub e: usize,
19     pub f: usize,
20     pub g: usize,
21     pub h: usize,
22     pub i: usize,
23     pub j: usize,
24     pub k: usize,
25     pub l: usize,
26     pub m: usize,
27 }
28
29 // @has 'item_hide_threshold/union.BigUnion.html'
30 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
31 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show fields'
32 pub union BigUnion {
33     pub a: usize,
34     pub b: usize,
35     pub c: usize,
36     pub d: usize,
37     pub e: usize,
38     pub f: usize,
39     pub g: usize,
40     pub h: usize,
41     pub i: usize,
42     pub j: usize,
43     pub k: usize,
44     pub l: usize,
45     pub m: usize,
46 }
47
48 // @has 'item_hide_threshold/union.Union.html'
49 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
50 pub union Union {
51     pub a: usize,
52     pub b: usize,
53     pub c: usize,
54 }
55
56 // @has 'item_hide_threshold/struct.PrivStruct.html'
57 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
58 // @has - '//div[@class="docblock type-decl"]' 'fields omitted'
59 pub struct PrivStruct {
60     a: usize,
61     b: usize,
62 }
63
64 // @has 'item_hide_threshold/enum.Enum.html'
65 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
66 pub enum Enum {
67     A, B, C,
68     D {
69         a: u8,
70         b: u8
71     }
72 }
73
74 // @has 'item_hide_threshold/enum.LargeEnum.html'
75 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
76 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show variants'
77 pub enum LargeEnum {
78     A, B, C, D, E, F(u8), G, H, I, J, K, L, M
79 }
80
81 // @has 'item_hide_threshold/trait.Trait.html'
82 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
83 pub trait Trait {
84     type A;
85     #[must_use]
86     fn foo();
87     fn bar();
88 }
89
90 // @has 'item_hide_threshold/trait.GinormousTrait.html'
91 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
92 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show associated items'
93 pub trait GinormousTrait {
94     type A;
95     type B;
96     type C;
97     type D;
98     type E;
99     type F;
100     type G;
101     type H;
102     type I;
103     type J;
104     type K;
105     type L;
106     type M;
107     const N: usize = 1;
108     #[must_use]
109     fn foo();
110     fn bar();
111 }
112
113 // @has 'item_hide_threshold/trait.HugeTrait.html'
114 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
115 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show associated constants and methods'
116 pub trait HugeTrait {
117     type A;
118     const M: usize = 1;
119     const N: usize = 1;
120     const O: usize = 1;
121     const P: usize = 1;
122     const Q: usize = 1;
123     const R: usize = 1;
124     const S: usize = 1;
125     const T: usize = 1;
126     const U: usize = 1;
127     const V: usize = 1;
128     const W: usize = 1;
129     const X: usize = 1;
130     #[must_use]
131     fn foo();
132     fn bar();
133 }
134
135 // @has 'item_hide_threshold/trait.BigTrait.html'
136 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
137 // @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show methods'
138 pub trait BigTrait {
139     type A;
140     #[must_use]
141     fn foo();
142     fn bar();
143     fn baz();
144     fn quux();
145     fn frob();
146     fn greeble();
147     fn blap();
148     fn whoop();
149     fn pow();
150     fn bang();
151     fn oomph();
152     fn argh();
153     fn wap();
154     fn ouch();
155 }