about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-07-09 11:50:34 -0700
committerGitHub <noreply@github.com>2020-07-09 11:50:34 -0700
commit38541b742aae367796c537c8575cc30811d42fb1 (patch)
tree6d0e65c31db4f464a20a6cb9dd1676bfb58619ca /src/test/rustdoc
parent89c9e970ddbe47622bcc52b135d35508510daa55 (diff)
parent368aa6f1e292d264bcb74fafa25069fe19c49450 (diff)
downloadrust-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.rs21
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
+    }
+}