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