]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/manual_impl.rs
rustbuild: fix remap-debuginfo when building a release
[rust.git] / src / test / rustdoc / manual_impl.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // @has manual_impl/trait.T.html
12 // @has  - '//*[@class="docblock"]' 'Docs associated with the trait definition.'
13 // @has  - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
14 // @has  - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.'
15 /// Docs associated with the trait definition.
16 pub trait T {
17     /// Docs associated with the trait a_method definition.
18     fn a_method(&self) -> usize;
19
20     /// Docs associated with the trait b_method definition.
21     fn b_method(&self) -> usize {
22         self.a_method()
23     }
24
25     /// Docs associated with the trait c_method definition.
26     ///
27     /// There is another line
28     fn c_method(&self) -> usize {
29         self.a_method()
30     }
31 }
32
33 // @has manual_impl/struct.S1.html '//*[@class="trait"]' 'T'
34 // @has  - '//*[@class="docblock"]' 'Docs associated with the S1 trait implementation.'
35 // @has  - '//*[@class="docblock"]' 'Docs associated with the S1 trait a_method implementation.'
36 // @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
37 // @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.'
38 // @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.'
39 // @has - '//*[@class="docblock"]' 'Docs associated with the trait c_method definition.'
40 // @!has - '//*[@class="docblock"]' 'There is another line'
41 // @has - '//*[@class="docblock"]' 'Read more'
42 pub struct S1(usize);
43
44 /// Docs associated with the S1 trait implementation.
45 impl T for S1 {
46     /// Docs associated with the S1 trait a_method implementation.
47     fn a_method(&self) -> usize {
48         self.0
49     }
50 }
51
52 // @has manual_impl/struct.S2.html '//*[@class="trait"]' 'T'
53 // @has  - '//*[@class="docblock"]' 'Docs associated with the S2 trait implementation.'
54 // @has  - '//*[@class="docblock"]' 'Docs associated with the S2 trait a_method implementation.'
55 // @has  - '//*[@class="docblock"]' 'Docs associated with the S2 trait c_method implementation.'
56 // @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
57 // @!has - '//*[@class="docblock"]' 'Docs associated with the trait c_method definition.'
58 // @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.'
59 pub struct S2(usize);
60
61 /// Docs associated with the S2 trait implementation.
62 impl T for S2 {
63     /// Docs associated with the S2 trait a_method implementation.
64     fn a_method(&self) -> usize {
65         self.0
66     }
67
68     /// Docs associated with the S2 trait c_method implementation.
69     fn c_method(&self) -> usize {
70         5
71     }
72 }
73
74 // @has manual_impl/struct.S3.html '//*[@class="trait"]' 'T'
75 // @has  - '//*[@class="docblock"]' 'Docs associated with the S3 trait implementation.'
76 // @has  - '//*[@class="docblock"]' 'Docs associated with the S3 trait b_method implementation.'
77 // @has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
78 pub struct S3(usize);
79
80 /// Docs associated with the S3 trait implementation.
81 impl T for S3 {
82     fn a_method(&self) -> usize {
83         self.0
84     }
85
86     /// Docs associated with the S3 trait b_method implementation.
87     fn b_method(&self) -> usize {
88         5
89     }
90 }