]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/issue-25001.rs
Rollup merge of #107662 - cjgillot:copy-projection, r=oli-obk
[rust.git] / tests / rustdoc / issue-25001.rs
1 // @has issue_25001/struct.Foo.html
2 pub struct Foo<T>(T);
3
4 pub trait Bar {
5     type Item;
6
7     fn quux(self);
8 }
9
10 impl Foo<u8> {
11     // @has - '//*[@id="method.pass"]//h4[@class="code-header"]' 'fn pass()'
12     pub fn pass() {}
13 }
14 impl Foo<u16> {
15     // @has - '//*[@id="method.pass-1"]//h4[@class="code-header"]' 'fn pass() -> usize'
16     pub fn pass() -> usize { 42 }
17 }
18 impl Foo<u32> {
19     // @has - '//*[@id="method.pass-2"]//h4[@class="code-header"]' 'fn pass() -> isize'
20     pub fn pass() -> isize { 42 }
21 }
22
23 impl<T> Bar for Foo<T> {
24     // @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' 'type Item = T'
25     type Item=T;
26
27     // @has - '//*[@id="method.quux"]//h4[@class="code-header"]' 'fn quux(self)'
28     fn quux(self) {}
29 }
30 impl<'a, T> Bar for &'a Foo<T> {
31     // @has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' "type Item = &'a T"
32     type Item=&'a T;
33
34     // @has - '//*[@id="method.quux-1"]//h4[@class="code-header"]' 'fn quux(self)'
35     fn quux(self) {}
36 }
37 impl<'a, T> Bar for &'a mut Foo<T> {
38     // @has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item = &'a mut T"
39     type Item=&'a mut T;
40
41     // @has - '//*[@id="method.quux-2"]//h4[@class="code-header"]' 'fn quux(self)'
42     fn quux(self) {}
43 }