diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-09 11:50:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-09 11:50:34 -0700 |
| commit | 38541b742aae367796c537c8575cc30811d42fb1 (patch) | |
| tree | 6d0e65c31db4f464a20a6cb9dd1676bfb58619ca /src/test/rustdoc | |
| parent | 89c9e970ddbe47622bcc52b135d35508510daa55 (diff) | |
| parent | 368aa6f1e292d264bcb74fafa25069fe19c49450 (diff) | |
| download | rust-38541b742aae367796c537c8575cc30811d42fb1.tar.gz rust-38541b742aae367796c537c8575cc30811d42fb1.zip | |
Rollup merge of #74107 - nbdd0121:rustdoc, r=GuillaumeGomez
Hide `&mut self` methods from Deref in sidebar if there are no `DerefMut` impl for the type. This partially addresses #74083.
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/issue-74083.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/rustdoc/issue-74083.rs b/src/test/rustdoc/issue-74083.rs new file mode 100644 index 00000000000..28585dafa14 --- /dev/null +++ b/src/test/rustdoc/issue-74083.rs @@ -0,0 +1,21 @@ +use std::ops::Deref; + +pub struct Foo; + +impl Foo { + pub fn foo(&mut self) {} +} + +// @has issue_74083/struct.Bar.html +// !@has - '//div[@class="sidebar-links"]/a[@href="#method.foo"]' 'foo' +pub struct Bar { + foo: Foo, +} + +impl Deref for Bar { + type Target = Foo; + + fn deref(&self) -> &Foo { + &self.foo + } +} |
