-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} |