-
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 #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.
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
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,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 | ||
} | ||
} |