]> git.proxmox.com Git - rustc.git/blob - src/test/rustdoc/deref-typedef.rs
New upstream version 1.52.0+dfsg1
[rustc.git] / src / test / rustdoc / deref-typedef.rs
1 #![crate_name = "foo"]
2
3 // @has 'foo/struct.Bar.html'
4 // @has '-' '//*[@id="deref-methods"]' 'Methods from Deref<Target = FooJ>'
5 // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_a"]' 'pub fn foo_a(&self)'
6 // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_b"]' 'pub fn foo_b(&self)'
7 // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_c"]' 'pub fn foo_c(&self)'
8 // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_j"]' 'pub fn foo_j(&self)'
9 // @has '-' '//*[@class="sidebar-title"][@href="#deref-methods"]' 'Methods from Deref<Target=FooJ>'
10 // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_a"]' 'foo_a'
11 // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_b"]' 'foo_b'
12 // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_c"]' 'foo_c'
13 // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_j"]' 'foo_j'
14
15 pub struct FooA;
16 pub type FooB = FooA;
17 pub type FooC = FooB;
18 pub type FooD = FooC;
19 pub type FooE = FooD;
20 pub type FooF = FooE;
21 pub type FooG = FooF;
22 pub type FooH = FooG;
23 pub type FooI = FooH;
24 pub type FooJ = FooI;
25
26 impl FooA {
27 pub fn foo_a(&self) {}
28 }
29
30 impl FooB {
31 pub fn foo_b(&self) {}
32 }
33
34 impl FooC {
35 pub fn foo_c(&self) {}
36 }
37
38 impl FooJ {
39 pub fn foo_j(&self) {}
40 }
41
42 pub struct Bar;
43 impl std::ops::Deref for Bar {
44 type Target = FooJ;
45 fn deref(&self) -> &Self::Target { unimplemented!() }
46 }