]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/deref-typedef.rs
Auto merge of #67758 - ssomers:testing_range, r=Mark-Simulacrum
[rust.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 = FooC>'
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="sidebar-title"]' 'Methods from Deref<Target=FooC>'
9 // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_a"]' 'foo_a'
10 // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_b"]' 'foo_b'
11 // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_c"]' 'foo_c'
12
13 pub struct FooA;
14 pub type FooB = FooA;
15 pub type FooC = FooB;
16
17 impl FooA {
18     pub fn foo_a(&self) {}
19 }
20
21 impl FooB {
22     pub fn foo_b(&self) {}
23 }
24
25 impl FooC {
26     pub fn foo_c(&self) {}
27 }
28
29 pub struct Bar;
30 impl std::ops::Deref for Bar {
31     type Target = FooC;
32     fn deref(&self) -> &Self::Target { unimplemented!() }
33 }