diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-08-19 12:26:47 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-19 12:26:47 +0530 |
| commit | ecd2885eedd62dba3744b5e5a7051c7bb6e1eca9 (patch) | |
| tree | 9eae3d73e1c14205d92ccc335008413b58fe7863 /src/test/rustdoc | |
| parent | 30e65cea07deacff8ab23388cf8ddf5e8b3caaaf (diff) | |
| parent | 748c6066551b2916726e0ec25b69120bb1c63b11 (diff) | |
| download | rust-ecd2885eedd62dba3744b5e5a7051c7bb6e1eca9.tar.gz rust-ecd2885eedd62dba3744b5e5a7051c7bb6e1eca9.zip | |
Rollup merge of #100731 - notriddle:notriddle/deref-methods-1, r=jsha
rustdoc: count deref and non-deref as same set of used methods Fixes #100679
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/issue-100679-sidebar-links-deref.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/rustdoc/issue-100679-sidebar-links-deref.rs b/src/test/rustdoc/issue-100679-sidebar-links-deref.rs new file mode 100644 index 00000000000..f09d2320609 --- /dev/null +++ b/src/test/rustdoc/issue-100679-sidebar-links-deref.rs @@ -0,0 +1,30 @@ +#![crate_name="foo"] + +pub struct Vec; + +pub struct Slice; + +impl std::ops::Deref for Vec { + type Target = Slice; + fn deref(&self) -> &Slice { + &Slice + } +} + +// @has foo/struct.Vec.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty"]' \ +// "is_empty" +impl Vec { + pub fn is_empty(&self) -> bool { + true + } +} + +// @has foo/struct.Vec.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty-1"]' \ +// "is_empty" +// @has foo/struct.Slice.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty"]' \ +// "is_empty" +impl Slice { + pub fn is_empty(&self) -> bool { + true + } +} |
