]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/manual_impl.rs
Rollup merge of #85645 - scottmcm:demote-from-into-try, r=yaahc
[rust.git] / src / test / rustdoc / manual_impl.rs
1 // @has manual_impl/trait.T.html
2 // @has  - '//*[@class="docblock"]' 'Docs associated with the trait definition.'
3 // @has  - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
4 // @has  - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.'
5 /// Docs associated with the trait definition.
6 pub trait T {
7     /// Docs associated with the trait a_method definition.
8     fn a_method(&self) -> usize;
9
10     /// Docs associated with the trait b_method definition.
11     fn b_method(&self) -> usize {
12         self.a_method()
13     }
14
15     /// Docs associated with the trait c_method definition.
16     ///
17     /// There is another line
18     fn c_method(&self) -> usize {
19         self.a_method()
20     }
21 }
22
23 // @has manual_impl/struct.S1.html '//*[@class="trait"]' 'T'
24 // @has  - '//*[@class="docblock"]' 'Docs associated with the S1 trait implementation.'
25 // @has  - '//*[@class="docblock"]' 'Docs associated with the S1 trait a_method implementation.'
26 // @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
27 // @!has - '//div[@class="impl-items"]/details[@open=""]//div[@class="docblock"]' 'Docs associated with the trait b_method definition.'
28 // @has - '//div[@class="impl-items"]/details//div[@class="docblock"]' 'Docs associated with the trait b_method definition.'
29 // @!has - '//div[@class="impl-items"]/details[@open=""]//div[@class="docblock"]' 'Docs associated with the trait c_method definition.'
30 // @has - '//div[@class="impl-items"]/details//div[@class="docblock"]' 'Docs associated with the trait c_method definition.'
31 // @!has - '//*[@class="docblock"]' 'There is another line'
32 // @!has - '//div[@class="impl-items"]/details[@open=""]//div[@class="docblock"]' 'Read more'
33 // @has - '//div[@class="impl-items"]/details//div[@class="docblock"]' 'Read more'
34 pub struct S1(usize);
35
36 /// Docs associated with the S1 trait implementation.
37 impl T for S1 {
38     /// Docs associated with the S1 trait a_method implementation.
39     fn a_method(&self) -> usize {
40         self.0
41     }
42 }
43
44 // @has manual_impl/struct.S2.html '//*[@class="trait"]' 'T'
45 // @has  - '//*[@class="docblock"]' 'Docs associated with the S2 trait implementation.'
46 // @has  - '//*[@class="docblock"]' 'Docs associated with the S2 trait a_method implementation.'
47 // @has  - '//*[@class="docblock"]' 'Docs associated with the S2 trait c_method implementation.'
48 // @!has - '//details[open=""]/div[@class="docblock"]' 'Docs associated with the trait a_method definition.'
49 // @!has - '//details[open=""]/div[@class="docblock"]' 'Docs associated with the trait c_method definition.'
50 // @!has - '//div[@class="impl-items"]/details[@open=""]//div[@class="docblock"]' 'Docs associated with the trait b_method definition.'
51 // @has - '//div[@class="impl-items"]/details//div[@class="docblock"]' 'Docs associated with the trait b_method definition.'
52 pub struct S2(usize);
53
54 /// Docs associated with the S2 trait implementation.
55 impl T for S2 {
56     /// Docs associated with the S2 trait a_method implementation.
57     fn a_method(&self) -> usize {
58         self.0
59     }
60
61     /// Docs associated with the S2 trait c_method implementation.
62     fn c_method(&self) -> usize {
63         5
64     }
65 }
66
67 // @has manual_impl/struct.S3.html '//*[@class="trait"]' 'T'
68 // @has  - '//details/div[@class="docblock"]' 'Docs associated with the S3 trait implementation.'
69 // @!has  - '//details[@open=""]/div[@class="docblock"]' 'Docs associated with the S3 trait implementation.'
70 // @has  - '//details[@open=""]/div[@class="docblock"]' 'Docs associated with the S3 trait b_method implementation.'
71 // @!has - '//div[@class="impl-items"]/details[@open=""]//div[@class="docblock"]' 'Docs associated with the trait a_method definition.'
72 // @has - '//div[@class="impl-items"]/details//div[@class="docblock"]' 'Docs associated with the trait a_method definition.'
73 pub struct S3(usize);
74
75 /// Docs associated with the S3 trait implementation.
76 impl T for S3 {
77     fn a_method(&self) -> usize {
78         self.0
79     }
80
81     /// Docs associated with the S3 trait b_method implementation.
82     fn b_method(&self) -> usize {
83         5
84     }
85 }