]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/issue-100679-sidebar-links-deref.rs
Rollup merge of #107662 - cjgillot:copy-projection, r=oli-obk
[rust.git] / tests / rustdoc / issue-100679-sidebar-links-deref.rs
1 #![crate_name="foo"]
2
3 pub struct Vec;
4
5 pub struct Slice;
6
7 impl std::ops::Deref for Vec {
8     type Target = Slice;
9     fn deref(&self) -> &Slice {
10         &Slice
11     }
12 }
13
14 // @has foo/struct.Vec.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty"]' \
15 //          "is_empty"
16 impl Vec {
17     pub fn is_empty(&self) -> bool {
18         true
19     }
20 }
21
22 // @has foo/struct.Vec.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty-1"]' \
23 //          "is_empty"
24 // @has foo/struct.Slice.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty"]' \
25 //          "is_empty"
26 impl Slice {
27     pub fn is_empty(&self) -> bool {
28         true
29     }
30 }