Skip to content

Commit d89bf91

Browse files
Display methods from DerefMut in the sidebar as well
1 parent d727071 commit d89bf91

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/librustdoc/html/render.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -4579,12 +4579,13 @@ fn get_methods(
45794579
i: &clean::Impl,
45804580
for_deref: bool,
45814581
used_links: &mut FxHashSet<String>,
4582+
deref_mut: bool,
45824583
) -> Vec<String> {
45834584
i.items.iter().filter_map(|item| {
45844585
match item.name {
45854586
// Maybe check with clean::Visibility::Public as well?
45864587
Some(ref name) if !name.is_empty() && item.visibility.is_some() && item.is_method() => {
4587-
if !for_deref || should_render_item(item, false) {
4588+
if !for_deref || should_render_item(item, deref_mut) {
45884589
Some(format!("<a href=\"#{}\">{}</a>",
45894590
get_next_url(used_links, format!("method.{}", name)),
45904591
name))
@@ -4625,7 +4626,7 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
46254626
.filter(|i| i.inner_impl().trait_.is_none())
46264627
.flat_map(move |i| get_methods(i.inner_impl(),
46274628
false,
4628-
&mut used_links_bor.borrow_mut()))
4629+
&mut used_links_bor.borrow_mut(), false))
46294630
.collect::<Vec<_>>();
46304631
// We want links' order to be reproducible so we don't use unstable sort.
46314632
ret.sort();
@@ -4659,7 +4660,8 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
46594660
.filter(|i| i.inner_impl().trait_.is_none())
46604661
.flat_map(|i| get_methods(i.inner_impl(),
46614662
true,
4662-
&mut used_links))
4663+
&mut used_links,
4664+
true))
46634665
.collect::<Vec<_>>();
46644666
// We want links' order to be reproducible so we don't use unstable sort.
46654667
ret.sort();

0 commit comments

Comments
 (0)